0
0

Hi all,

I am wondering how to get the data decoded by a stream (i.e. if I open an mp3 file, I want the raw PCM data as decoded by FMOD).

I am unable to use samples because the files I decode are fairly large.
I have been able to use FSOUND_Stream_GetSample() to get a sample handle and have also been able to store the result to a file – but I don’t know how much I am to jump forward in the stream when I have written the data to the file. If I use
FSOUND_Stream_SetTime(Stream, FSOUND_Stream_GetTime(Stream) + 400);
the data is not at all contiguous which is what I want to achieve.
(I got 400 from the FMOD documentation somewhere or other).

Any help would be very much appreciated.

Best regards,

Peter.

  • You must to post comments
0
0

You have to either load the whole thing into memory using FSOUND_Sample_Load then get the pcm data with FSOUND_Sample_Lock/Unlock, or use FMOD Ex and use Sound::readData functions.

  • You must to post comments
0
0

Thanks, Brett.

I have another question (still related to the previous one):

I have come to the conclusion that I must use samples, but have hit another wall.

I know it is possible to specify the offset in bytes of a file to load and the length of a data segment. But in all the cases I have tried this, FMOD returns null.
My FSOUND_Sample_Load function call looks like this:
FSOUND_SAMPLE* Sample = FSOUND_Sample_Load(FSOUND_FREE, "Test.mp3", 0, 1024, 2048);
[The numbers are randomly selected]
When I try to lock the data I get 0 bytes. What am I doing wrong?

I, as always, look forward to any reply.

Best regards,

Peter.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.