0
0

Hello bros,

i’m trying to play a single mod file, using fmodex 4.00.35.

Look what I already do:

[code:2e5jknc7]
var
Form1: TForm1;
sound1b: FMOD_SOUND;
system: pointer;
channel: FMOD_CHANNEL;

procedure ERRCheck(resp: FMOD_RESULT);
begin
if resp <> FMOD_OK then
showmessage(’Erro com o FMOD! ‘ + FMOD_ErrorString(resp));

end;

procedure TForm1.FormCreate(Sender: TObject);
var
res: FMOD_RESULT;
system: pointer;
version: cardinal;

begin
res := FMOD_System_Create(system);
ERRCHECK(res);

res := FMOD_System_GetVersion(system,version);
ERRCHECK (res);

if version <> FMOD_VERSION then
showmessage(’Erro! Você está usando uma versão antiga de FMOD’ + IntToStr(version) +
‘Este programa requer ‘ + IntToStr(FMOD_VERSION));

res := FMOD_System_Init(system, 32, FMOD_INIT_NORMAL, nil);
ERRCHECK(res);

res := FMOD_System_CreateSound(system, Pchar(’c:\temp\premiere.mod’), FMOD_HARDWARE, nil, sound1b);
ERRCHECK (res);

res := FMOD_Sound_SetMode(sound1b, FMOD_LOOP_OFF);
ERRCHECK (res)

end;

procedure TForm1.Button1Click(Sender: TObject);
var
res: FMOD_RESULT;
begin
// The Play button
res := FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound1b, false, channel);
ERRCHECK(res);
end;
[/code:2e5jknc7]

When i press the Play button i have the follow error message:
An invalid parameter was passed to this function.

So, what is this invalid parameter?

Thankz all
Jack

  • You must to post comments
0
0

May be it looks strange to you, but try running the code without error checking to see what happens. In C# sometimes I have a problem like this with ERRCHECK function. This is actualy not an answer to your question:)

  • You must to post comments
0
0

[quote="jackstuard":rnbsxaku]Hello bros,
[code:rnbsxaku]
var
Form1: TForm1;
sound1b: FMOD_SOUND;
system: pointer;
channel: FMOD_CHANNEL;

...

procedure TForm1.FormCreate(Sender: TObject);
var
res: FMOD_RESULT;
system: pointer;
version: cardinal;

begin
...
end;

procedure TForm1.Button1Click(Sender: TObject);
var
res: FMOD_RESULT;
begin
// The Play button
res := FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound1b, false, channel);
ERRCHECK(res);
end;
[/code:rnbsxaku]
[/quote:rnbsxaku]

Remove the local declaration, and it must work :)

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.