0
0

Hey guys,

I want to play raw pcm (signed 8 bit) that is stored in a byte array in my C#.NET application.
I looked through the examples for VC# that came with the API package but it only showed how to play files out of memory containing all header structure and so on but I just have not more than raw data and a samplerate stored in a variable.

Hope you can help me 😉

  • You must to post comments
0
0

It seems like you will have to use a combination of FMOD_OPENMEMORY, FMOD_CREATESAMPLE and, maybe, FMOD_OPENRAW when creating the sound, plus some FMOD_CREATESOUNDEXINFO. The OPENMEMORY explains itself, the CREATESAMPLE will copy the data to fmod internal buffer so you can free your buffer after creating the sound (mixing native and managed code is a pain and this should minimize the need for that). OPENRAW "will ignore file format and treat as raw pcm" as the documentation states, but I don’t know if you will need it.

You will need to provide some info in your CREATESOUNDEXINFO structure. Probably these: length, numchannels, defaultfrequency, format, suggestedsoundtype.

Hope this helps.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.