Currently I’m developing an sound processing program with FMOD.
My program process thorough music at the start time. So, the speed is really important.
My program takes 3sec for a 4min music. And two-third of that time is used just for FSOUND_Update(). ( I tested it without any filter).
My coding like this.
FSOUND_Init(44100, 128, FSOUND_INIT_STREAM_FROM_MAIN_THREAD)
int limit = ((float) (FSOUND_Stream_GetLengthMs(stream) – FSOUND_Stream_GetPosition(stream))/ 1000.0f) * (44100.0f / 1024.0f );
for( int i=0; i< limit; i++)
FSOUND_Update(); // 43 times update means 1sec
Is there anyway to accelerate this process?
Or anyone can recommand any other method?
- kiplring asked 13 years ago
1) Use the flag FSOUND_LOADMEMORY in FSOUND_Stream_Open.
3) I didn’t still prove it but one could make using FSOUND_Stream_SetTime or FSOUND_Stream_SetPosition to define where to begin and continuing with FSOUND_Update until the place where you want to finish. The quantity of data that will return the callback will be of 44100 samples per second (for a file of these characteristics). Then if you want to process 20 seconds in a file of 1 minute beginning from the 30 seconds, you would have to be positioned in the 30 seconds and to make FSOUND_Update some (882000 / size of the buffer) times. (20 x 44100 = 882000 samples).
- LeoCombes answered 13 years ago
What are you trying to process?? It looks to me like you are just calling FSOUND_Update several times. The only thing that FSOUND_Update does is tell FMOD to get the next chunk of data. I would recommend using a DSP callback to process files, then when you use FSOUND_Update it would send the next chunk of data to your DSP callback for processing.
- Paranoid_Android answered 13 years ago
As Paranoid_Android said, I’m processing whole file with DSP callback with FSOUND_Update(). But it takes so long time.
I want dramatic cut down of the execution time.
Brett, can you tell me how to iterate each samples(or chunk of samples) after FSOUND_Sample_Load?
And, their are any way to FSOUND_Sample_Load target to only some part of a sound? ( to save time and memory)
[quote]The fastest way is to decode the whole thing into memory.[/quote]
What function can be used for load whole MP3 into memory?
How can I iterate( or get chunk of them) the data loaded in memory.
Can I load some part of MP3 into memory?
Thanks. The answer of these will really big helps for me.
Please login first to submit.