Sound & Music

Moderators: Sephiroth
Number of threads: 597
Number of posts: 1201

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Question regarding streaming wav file Posted by kanchanc on 2 Nov 2004 at 5:37 PM
Hi,

I want to stream wav file from server to client. I am able to read the wav file header and the data. I have the following questions:-

1. How do I break the wav file into small chunks for real time streaming?
2. How do I manage the buffer at client and server side?

Thanks.

Report
Re: Question regarding streaming wav file Posted by Sephiroth on 2 Nov 2004 at 9:03 PM
I suggest you head over to GameDev and check out Beej's Socket Tutorial. You see, you have to know TCP/IP and/or UDP/IP to do what you'd like to do. Sockets are simple enough to do, until you start dealing with firewalls and such. Anyway, once you get a socket open and connected, you simply write to it as though it is a file! You can easily set the buffer size and such, read that buffer from your WAV source, then write it to the socket. Network coding is a LOT simpler than you think!

-Sephiroth

Report
Re: Question regarding streaming wav file Posted by kanchanc on 2 Nov 2004 at 9:28 PM
I have a connection between client and server working. I want to use RTP for real-time audio streaming from client to server. On server side, I am able to read the wav file. Now the question is how to send the wav file in chunks to the client?

My understanding for that is the client should have a buffer and the server sends data in small parts to client. The client plays the buffered data, & by that time the server sends further data. I am confused how to break the wav file.

Thanks.

: I suggest you head over to GameDev and check out Beej's Socket Tutorial. You see, you have to know TCP/IP and/or UDP/IP to do what you'd like to do. Sockets are simple enough to do, until you start dealing with firewalls and such. Anyway, once you get a socket open and connected, you simply write to it as though it is a file! You can easily set the buffer size and such, read that buffer from your WAV source, then write it to the socket. Network coding is a LOT simpler than you think!
:
: -Sephiroth
:
:

Report
Re: Question regarding streaming wav file Posted by Sephiroth on 4 Nov 2004 at 7:48 PM
The same way you would write part of a buffer to a stream. You don't physically 'break' the actual file, you only read part of it at a time.

-Sephiroth




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.