0
0

[b:2syjoh4h]Scenario:[/b:2syjoh4h] You’ve got a large audio file (say, 50+ minutes), and you need to access the audio data for something OTHER than playback (e.g., you want to create another audio file, or you want to do something with the pcm values, or whatever).

You can’t use Sample_Load because the file is simply too big, and–as Brett explained clearly in another post–the offset/length method doesn’t allow you to load select chunks of audio data; you must load the entire audio program, or load from byte-0 onward. <<< Had I not asked, I would have assumed there was a bug in the procedure.

I need an alternate method to ‘step through’ large audio files, so that I can access the decoded pcm data. The process must be seamless, because the data are to be written to a new WAV file.

Right now I have a method that–unfortunately–is only working correctly with uncompressed WAV sources:

(a) Open the large file in stream mode (which exposes a handle to sample data).
(b) Use the byte-seek method (Stream_SetPosition) to step through the entire file.
(c) Each time the stream position changes, the sample is also updated automatically (FMod does this, not me).

It seems simple, but it does work properly with standard WAV files. [One can import a WAV file and export an exact duplicate.] However, if the source file is an MP3, only partial sample data are accessed during each step, resulting in a new file that is missing, say, 70% of the audio data.

So, back to the task at hand. What is the proper way to seamlessly access the audio data from large files in FMod, when playback is not needed? Or, how might the above method be revised to deal with compressed sources?

In anticipation, many thanks,

  • SD

P.S. At the risk of sounding presumptuous, please allow me to suggest that there ought to be a “Sample_Load” procedure that really does what I first thought it did: Loads and decodes a desired segment of audio data from a file. It would surely be a “good” thing, yes?

  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.