0
0

hi,

i got a new error.
Here’s how i do it:

I initiate a first system and load a track into it.
Now i load a second system after a button click, this system has a while loop until track ends for wav writing.
In this loop i call systemupdate just for the second system (and no its not in a thread its in the main thread).

Now this system update keeps crashing.

As far as i delete the initiating of the first system everything works just fine.

System1:
[code:2m62d77l]
procedure PlayerInit( pl: pPlayer);
var
i:integer;
begin

FmodSys.result := FMOD_System_Create(pl.system);
ERRCHECK(FmodSys.result);

//Choose the highest mode possible.
//If the user doesn’t have 7.1 speakers, then only the speakers they have will be audible.
FmodSys.result := FMOD_System_SetSpeakerMode(pl.system, FMOD_SPEAKERMODE_7POINT1);
ERRCHECK(FmodSys.result);

FModSys.result:= FMOD_SYSTEM_SetOUTPUT(pl.system, FMOD_OUTPUTTYPE_AUTODETECT);
ERRCHECK(FmodSys.result);

FmodSys.result:= FMOD_System_setDriver(pl.system, pl.driver);
ERRCHECK(FmodSys.result);

FmodSys.result := FMOD_System_Init(pl.system, 32, (FMOD_2d or FMOD_SOFTWARE), nil);
ERRCHECK(FmodSys.result);

FmodSys.result := FMOD_system_CreateStream(pl.system, ‘C:\test.mp3’, FMOD_SOFTWARE, nil, Pl.sound);
ERRCHECK(FmodSys.result);

FmodSys.result :=  FMOD_SYSTEM_CREATECHANNELGROUP(pl.system, 'ALLgroup', pl.AllChannel);

ErrCheck(FmodSys.result);

FmodSys.result := FMOD_Sound_SetMode(Pl.sound, FMOD_LOOP_OFF);
ERRCHECK(FmodSys.result);

FmodSys.result := FMOD_System_PlaySound(pl.system, FMOD_CHANNEL_FREE, pl.sound, true, pl.Channel);
ERRCHECK(FmodSys.result);

FmodSys.result := FMOD_Channel_SetSpeakerMix(pl.Channel, 1,1, 0, 0, 0, 0, 0, 0);

ERRCHECK(FmodSys.result);

Fmodsys.result := Fmod_Channel_SetChannelGroup(pl.channel, pl.AllChannel);
ErrCheck(FmodSys.result);

for i:=0 to 13 do
begin
FMOD_System_createDSPByType(pl.system, FMOD_DSP_TYPE_PARAMEQ, pl.eq_band[i]);
ERRCHECK(FmodSys.result);

end;

FMOD_System_createDSPByType(pl.system,  FMOD_DSP_TYPE_PITCHSHIFT,  pl.eq_band[14]);
ERRCHECK(FmodSys.result);

end;

[/code:2m62d77l]

Ripper System Function:
[code:2m62d77l]
procedure RipTracks();
var
drive: string;
filename:string;
ripsystem: FMOD_SYSTEM;
Ripsound, Ripcdsound: FMOD_SOUND;
Ripchannel: FMOD_CHANNEL;
result: FMOD_RESULT;

RowNr,i,countChild,numtracks:integer;
files: array[0..255] of char;
lenms,ms:cardinal;
version:Cardinal;
Tree:TVirtualStringTree;
Node:PVirtualNode;
path:string[255];
lame:TlameCoder;
done:boolean;
begin

Drive:=’G:’;
path:=Settings.SaveTo;
countChild :=Tree.ChildCount[nil];

i:=0;

filename:=path+'\Track_'+inttostr(i+1)+'.wav';

move(filename[1],  files,length(filename));
files[length(filename)]:=#0;




result := FMOD_System_Create(ripsystem);

ErrCheck(result);

result := FMOD_System_GetVersion(ripsystem, version);
ERRCHECK(result);

if (version < FMOD_VERSION) then begin
showmessage(Format(’Error! You are using an old version of FMOD %.8x. This program requires %.8x’, [version, FMOD_VERSION]));
end;

  result:= FMOD_SYSTEM_SetOUTPUT(ripsystem, FMOD_OUTPUTTYPE_WAVWRITER_NRT);

ERRCHECK(result);

result := FMOD_System_Init(ripsystem, 1, FMOD_INIT_STREAM_FROM_UPDATE, @files);
ERRCHECK(result);
result := FMOD_System_CreateStream(ripsystem, pchar(drive), FMOD_OPENONLY, nil, Ripcdsound);
ERRCHECK(result);
result := FMOD_Sound_GetNumSubSounds(ripcdsound, numtracks);
ERRCHECK(result);
result := FMOD_Sound_GetSubSound(ripcdsound, i, ripsound);
ERRCHECK(result);

result := FMOD_System_PlaySound(ripsystem, FMOD_CHANNEL_FREE, ripsound, false, ripchannel);
ERRCHECK(result);
result:=FMOD_Channel_SetCallback( ripchannel,FMOD_CHANNEL_CALLBACKTYPE_END, @CallbackRipper, 0 );

ERRCHECK(result);

result := FMOD_Sound_GetLength(ripsound, lenms, FMOD_TIMEUNIT_MS);
ERRCHECK(result);

done := false;

while(done = false) do
begin
CSection.Acquire;
try
done := RipTrackDone;
finally
CSection.Release;
end;

[color=red] result:=FMOD_SYSTEM_UPDATE(ripsystem); // ITS CRASHING HERE
ERRCHECK(result); // OR HERE[/color]

sleep(0);
Application.ProcessMessages;

end;

if ripsound <> nil then begin
result := FMOD_Sound_Release(ripsound);
ErrCheck(result);
end;
if ripcdsound <> nil then begin
result := FMOD_Sound_Release(ripcdsound);
ErrCheck(result);
end;

if ripsystem <> nil then begin
result := FMOD_System_Close(ripsystem);
ErrCheck(result);
result := FMOD_System_Release(ripsystem);
ErrCheck(result);
end;
RipTrackdone:=false;

end;
[/code:2m62d77l]

  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.