0
0

Brett,

It is my understanding from the docs that FSOUND_Sample_Load can be used to load audio data from a file, OR from a segment of a file.

From the simple VB demo (using FMod 3.73):

[code:255qvk12]
sampleHandle = FSOUND_Sample_Load(FSOUND_FREE, CommonDialog1.filename, FSOUND_NORMAL, 0, 0)
[/code:255qvk12]
…works (provided there is sufficient memory to load the entire file).

[code:255qvk12]
sampleHandle = FSOUND_Sample_Load(FSOUND_FREE, CommonDialog1.filename, FSOUND_NORMAL, 0, 16384)
[/code:255qvk12]
…works (loads–and can play–the first 16,384 bytes)

but…
[code:255qvk12]
sampleHandle = FSOUND_Sample_Load(FSOUND_FREE, CommonDialog1.filename, FSOUND_NORMAL, 16384, 16384)
[/code:255qvk12]
…raises the ‘Unknown file format’ error.

It doesn’t seem to matter how big the chunk is, or the position of the desired chunk. When offset > 0, there is an error. I have tried loading a sample segment from both WAV and MP3 files.

Why does this method fail? Must I always load from the beginning of the file?

Regards,

  • SD
  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.