I’ve heavily studied the help file and it didn’t solve my problem. I want to load whole file to a memory buffer (with headers and everything) and then Load a sample from memory. I use Sample = FSOUND_Sample_Load(FSOUND_FREE,buf,FSOUND_NORMAL | FSOUND_LOADMEMORY,buflen); and it returns an error (10 – bad format). I tried with FSOUND_LOADRAW, it loads a sample (or it just says so) but the sound is not playing. The file is WAVE (PCM) 22050hz 16bit mono. I tried to set the MODES to 16BITS, MONO etc. but it doesn’t work. What should I do to load a sample from an exact copy of a file in memory ?
- Darky asked 16 years ago
The file is WAVE (PCM) 22050Hz, 16Bit, Stereo (I’ve tried with mono too), Windows’ standard media file tada.wav. I initiate the fmod with following properities: DSOUND output (also tried with WMedia), 22050Hz, 32 soft channels, default driver (0), mixer is autodetected, master volume 255. I load the whole file (with headers and everything) into a previously allocated memory buffer, and then I use Sample = FSOUND_Sample_Load(FSOUND_FREE,buf,FSOUND_LOADMEMORY | FSOUND_LOADRAW | FSOUND_2D | FSOUND_LOOP_OFF | FSOUND_16BITS | FSOUND_STEREO,bufsize) (also tried with different configurations of MODES with no effect). The sample seems to be created (it’s not NULL) and no error message is generated. Then I use FSOUND_PlaySound(FSOUND_FREE,Sample) to play the sample. But I hear nothing. What’s funny I had no problems with playing streaming mp3 file on the same settings of the fmod. I hope I’ve written everything needed to help me. If not then I may give you my source code (it’s very small, 4 functions, 61 lines) or maybe you have a link to a tutorial or example of what I need ? Looking forward for your reply. Darky
Please login first to submit.