0
0

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
end;[/code:1mqdu85h]

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.

Thanks

Martin
dynamic.soundwave

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
FMOD 3.74

  • You must to post comments
0
0

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.

HTH

kimB

  • You must to post comments
0
0

Hi kimB.

I’ll test it the next week or so.
Btw my laptop crashed yesterday and is now in repair. ๐Ÿ˜ฅ So no programming the next days.

I’ll post again if I have the laptop back.

Thanks

Martin
dynamic.soundwave

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.