0
0

Hi all!

I’m having some trouble with the fmod fx. I cant get them to work. This is my code, with help of the FAQ:

Vars:
[code:3n59bp8z] Sample1: PFSoundSample;
Channel: integer;[/code:3n59bp8z]

Button1 click:

[code:3n59bp8z]
procedure TfrmMixer.Button1Click(Sender: TObject);
begin

Channel := 1;

if not FSOUND_Init(44100, 64, 2) then begin
MessageBox(0, ‘Could not initialize sound’, ‘Error’, 16);
end;

Sample1 := FSOUND_Sample_Load(1, ‘e:\pathtosome.mp3’, FSOUND_NORMAL, 0, 0);

FSOUND_PlaySoundEx(Channel, Sample1, nil, true);
end;
[/code:3n59bp8z]

Button2 click:

[code:3n59bp8z]procedure TfrmMixer.Button2Click(Sender: TObject);
var
Id: integer;
begin
FSOUND_SetPaused(Channel, true);
Id := FSOUND_FX_Enable(Channel,FSOUND_FX_ECHO);
FSOUND_SetPaused(Channel, false);

if not FSOUND_FX_SetEcho(Id, 1, 1, 1, 0, 0) then begin
showmessage(’Could not apply effect. ‘ + #13#10 + ‘Enabler said: ‘ + IntToStr(Id));
end;
end;[/code:3n59bp8z]

I searched the forums here, and found out that I had to Init with ‘FSOUND_INIT_ENABLESYSTEMCHANNELFX’. But when doing this, I get my ‘Could not initialize sound’ error.

If I set the value to ‘2’ (like I did in my code) it does play, but when trying to enable an effect, the FSOUND_FX_Enable returns False. (Probably quite logical because I didn’t initialize with the right flags)

I’m really stuck and must be doing something wrong (doh :P).

Can anyone please help me? Thanks in advance.

Nico.

Btw, I use fmod 374

  • You must to post comments
0
0

Thanks for your reply, but when I implement it, it still doesnt work, and I get no output at all. [img:38ju40od]http://www.fmod.org/forum/images/smiles/icon_frown.gif[/img:38ju40od]

The documentation I find a bit vague. I miss the examples. (Examples included with fmod api are extended with fancy stuff, I prefer short simple code that just simply works :-), but ah, who am I..)

Nico.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.