0
0

OK, i’m using fMOD as the audioengine for my mediaplayer, before I used BASS, but I found fMOD to be better in many ways. One thing thing I could do in BASS though was an easy Equalizer, but I haven’t been able to get this working with fMOD 3.7.3.0. I’ve got no idea if i’m on the right track at all, so please give me some help here. Anyways, I started out with some simple code.

[code:21s7wtr2]// program variables
var
Stream: TStream;
Channel, FXid: integer;
[/code:21s7wtr2]

[code:21s7wtr2]// create form and init fmod
procedure TForm1.FormCreate(Sender: TObject);
begin
FSOUND_Init(44100, 16, 0);
FSOUND_SetOutput(FSOUND_OUTPUT_WINMM);
FSOUND_SetDriver(0);
end;
[/code:21s7wtr2]

[code:21s7wtr2]// open and play file with TOpenDialog1
procedure TForm1.Button1Click(Sender: TObject);
var
Mode: TFsoundFxModes;
begin

if OpenDialog1.Execute then
begin
Stream := FSOUND_Stream_Open(PChar(OpenDialog1.Filename), FSOUND_NORMAL, 0, 0);
Channel := FSOUND_Stream_PlayEx(FSOUND_FREE, stream, NIL, True);

Mode:= FSOUND_FX_PARAMEQ;
FXid:= FSOUND_FX_Enable(Channel, Mode);

if FXid = -1 then
ShowMessage(Argh! It didnt work!’);

FSOUND_SetPaused(Channel, False)
end;

end;
[/code:21s7wtr2]

[code:21s7wtr2]// when TTrackBar1 is changed SetParamEq should be updated
procedure TForm1.TrackBar1Change(Sender: TObject);
begin

if FSOUND_FX_SetParamEQ(FXid, 8000, 12, TrackBar1.Position) = false then
ShowMessage(’Failure on FSOUND_FX_SetParamEQ’);

end;
[/code:21s7wtr2]

FXid is allways returned as -1, so if anyone could please help me I would be grateful. And yes, I have searched the forum but did not find anyone who seemed to have the same problem as I have (atleast not in pascal). I read somewhere that you have to init fmod with [i:21s7wtr2]FSOUND_INIT_ENABLEOUTPUTFX[/i:21s7wtr2], could this be it? I would also be happy if someone posted some working code I could look at to see how it’s done.

Thanks.

  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.