0
0

Hi! Im developing kind of networked music player that reads file paths from files and just plays one sound after another. I was using directsound, but it did not work in this case, because i need maximum stability and performance on this. So im thinking about using fmod, but i cant find any suggestions how to do what i need… Basically i need to play sequence of files using streaming (from file that resides on networked hard drive, so basically just a file), and have simple functions like stop/play/pause/resume, thats about it.

So the questions would be :

How should i use fmod with C#? Is using p/invoke to call fmodex.dll functions is the best choice?
How do i setup simple sound streaming?
I see that i need to provide sample rate when initializing sound system, will this give me bad performance if i play files that are not of this sampling frequency? (eg fmod will need to resample data)
How can i construct my program that plays one file after another? (i need some kind of callback that signalizes end of playing current sound)
Ah and forgot really important thing – i need to select sound card manually and distinguish between two sound cards even if they are the same name (in directsound i used device GUID’s, but can i do this in fmod?).

  • You must to post comments
0
0

Hi Semei, welcome to the FMOD forums!

[quote:3d3p9ar6]How should i use fmod with C#? Is using p/invoke to call fmodex.dll functions is the best choice?[/quote:3d3p9ar6]
We supply and C# wrapper for FMOD you can just use that.

[quote:3d3p9ar6]How do i setup simple sound streaming?[/quote:3d3p9ar6]
System::createStream (or System::createSound with the FMOD_CREATESTREAM flag). Check out the playstream example.

[quote:3d3p9ar6]I see that i need to provide sample rate when initializing sound system, will this give me bad performance if i play files that are not of this sampling frequency? (eg fmod will need to resample data)[/quote:3d3p9ar6]
You don’t have to supply an output sample rate, FMOD will default to use the system default rate. FMOD contains a high performance resamplers, so even if your files are at a different rate the performance hit should be minimal.

[quote:3d3p9ar6]How can i construct my program that plays one file after another? (i need some kind of callback that signalizes end of playing current sound)[/quote:3d3p9ar6]
You can use the FMOD_CHANNEL_CALLBACKTYPE_END to detect when a sound has finished playing. You could also use realtime stiching with subsound sentences to queue up the files and just play them as a sentence through FMOD. Check out the realtimestitching example.

[quote:3d3p9ar6]Ah and forgot really important thing – i need to select sound card manually and distinguish between two sound cards even if they are the same name (in directsound i used device GUID’s, but can i do this in fmod?).[/quote:3d3p9ar6]
You can use System::setDriver for this. Check out the multiplesoundcard example.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.