first time for me here at fmod.org.
Just downloaded the API, and it does what it says. Really good work, I had the first MP3 playing after 10 min
But now I got into serious problems. I’m trying to extract the Audio Part of an AVI and play it with fmod. What I get from the AVI File Lib are chunks of Data, with a WAVEHDR Header. Just tried to load them with FSOUND_Stream_OpenFile() and FSOUND_LOADMEMORY, but it seems as if he doesn’t recognizes the data type.
Has anyone ever tried to get the Audio from an AVI ? I didn’t found much on the I-Net, and the AVI File lib is very instable in handling.
So could you guys redirect me to a good link about it (please not “Working with AVI Files”, I read this 1000x times
Thx in advance
- Maddi asked 15 years ago
Recently I got the Data extracted from the File. I used one with PCM Audio data and putted it directly into the Buffer, then loaded with LOADRAW. This worked, altough the playback was to slow, but nevermind.
So I wondered, if I could set the Format specifically, because I get a “Format ID” from the AVI, which I could perhaps pass into.
Thx in advance
- Maddi answered 15 years ago
It’s been a while since this has been posted, but I thought i’d reply anyway. I’ve currently been able to read PCM and WAV format out of an AVI. What I had to do was basically rebuild a wav from scrath.
audioData = (byte *)malloc(lBufferSize+lHeaderSize+28); memcpy(audioData, "RIFF", sizeof(byte)*4); memcpy(audioData+4, &total_size, sizeof(long)); memcpy(audioData+8, "WAVE", sizeof(byte)*4); memcpy(audioData+12, "fmt ", sizeof(byte)*4); memcpy(audioData+16, &lHeaderSize, sizeof(long)); memcpy(audioData+20, &waveHeader, lHeaderSize); memcpy(audioData+20+lHeaderSize, "data", sizeof(byte)*4); memcpy(audioData+24+lHeaderSize, &lBufferSize, sizeof(long));
and after all that mess, i just keep on reading the streamed data into audioData+lHeadSize+28, and then:
FSOUND_Stream_OpenFile((char *)audioData, FSOUND_NORMAL | FSOUND_LOADMEMORY , lBufferSize+lHeadSize+28);
I’ve still had a few problems though. Firstly, I’m still having problems reading in MP3 compressed audio properly, but that really has nothing to do with FMOD. Secondly, I think I SHOULD only have to use FSOUND_Stream_OpenFile once and just use FSOUND_Stream_Play after I update the memory, but if I do that, the sound only plays for about half a second rather than a full second. Now if I completly reopen the stream after I update the memory, it plays fine… but that hogs a lot of memory and seems to really slow it down.
If anyone out there has any ideas, i’d love to hear em,
- flexei answered 15 years ago
Please login first to submit.