Hi @ all.
First : FMOD is incredible. Great Work! 😀
Now to my problem.
I used FMOD in different programms I wrote, f.e. mp3 player -> everything works fine (using multiple streams and software mixing).
In a new programm I want to create a peak like cool edit has. After a little bit searching I found GetCurrentLevels. -> First try: playing a mp3-file and using a timer (50 ms) to get the values. No problem here. Painted them in an image.
Looked like that:
Worked great (I thought). Putting the values directly in a kind of peakmeter worked too.
The problem is, if you have a file of 3min 30 the calculation needs 3min 30. 😕
To shorten this I tried a for next loop. Reading every 1000st position of an mp3 file.
( fmodstream > the streamed file
lengthofmp3file > value I got with FSOUND_Stream_GetLengthms
leftchannel, rightchannel > a SINGLE value)
[code:1mqdu85h]for counter:=0 to 1000 do begin
FSOUND_Stream_Setposition ( fmodstream , round ( lengthofmp3file * counter ) / 1000 ) ) ;
FSOUND_GetCurrent_Levels ( 0 , @leftchannel , @rightchannel ) ;
...// do the rest
The problem is, that leftchannel and rightchannel are always 0.
I thought of the buffer (the part of the stream isn’t loaded) ?!?
Perhaps you can help me.
PS. Thought also of a WAV file (uncompressed). There you can read the values directly from the file.
PPS. Can I use FMOD with a soundcard with 4 stereo outputs (1 stream zu each output)?
Boland Delphi 6.0 German
- Dynamic.Soundwave asked 11 years ago
Sorry I don’t know much about cooledit but:
If you want a realtime oscillator or eq type meter there is a demo in the FMOD 3.xx Testbed Delphi project.
If you mean you want to draw a non-realtime waveform as you would in a wave editor app then you need to set FMOD playback to non realtime then lock the playback, read the data then unlock and advance the playback manually. There is a demo somewhere on this forum that mixes two wave files together using fmod, the principle is the same.
- kimb answered 11 years ago
Please login first to submit.