![]() |
Streaming Sound Over a Socket
I am trying to stream sound over a socket. I am using the FMOD SoundSystem libraries to play the music. I am not expecting people to know FMOD, but maybe you guys could still help me out a bit. I can set up FMOD to stream the file when playing it, I just have to figure out how I can send the data through the socket in chucks and have FMOD playing the chunks while its doing the transferring.
I have the file sending through the socket in chunks working: :
// receiving endFMOD code to stream a file and play it: :
FMOD::System* system = 0;Any help at all on how to tackle this would be great. |
Does anyone even know if I have to set up the socket a specific way to handle streaming?
|
I think you are taking the wrong approach to this... writing the data to a file and having that file stream back to the audio player. You might manage to make it work, but at the cost of processing power, and what happens to streams that keep on going, the data file can not be easily trimmed.
You need to either everload the classes/functions responsible for stream the data from a file to use a socket escriptord and handle reading the data from the socket instead of the file, or you have to find a way to send data buffers into FMOD and write the data directly into the buffer as it is being received. Typically these buffers are cyclical allowing you to easily create a data stream (this is how Direct Sound generally works). I don't know FMOD very well, so that is really all the help I can give you, and I don't know how well FMOD will handle doing it the right way. |
Ok thanks for the tips. I think I will just have to research how FMOD works a bit more. I think I am going to leave that for now and finish the rest of the sockets library I am creating (I will probably start a new thread for reviews on it when I get more of it done).
|
| All times are GMT -5. The time now is 2:07 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC