FMUSIC_StopSong() just won’t work for me. (FMOD 3.74)
I am sure Im using the right FMUSIC Module Name as Parameter, it just won’t stop.
I am now using the FMUSIC_FreeSong() function, but that slows my application down a lot, because I need to load the files to play everytime again after I clicked my “Stop” Button.
Is this a known issue or am I the only one?
- Benjin asked 13 years ago
Well, here are excerpts of my code, which means all parts which include FMOD commands:
(Error Warnings are in german, sorry. But they wont matter)
I am intializing the following FMOD component:
On FormCreate I do
InitAudio looks like this:
if FMOD_VERSION > FSOUND_GetVersion then
Showmessage(’Error: falsche Version’);
//Sets up the soundsystem output mode.
if not FSOUND_SetOutput(FSOUND_OUTPUT_WINMM) then
Showmessage(’Error: Fehler bei FSOUND_SetOutput’);
if not FSOUND_SetDriver(0) then
Showmessage(’Error: Fehler bei FSOUND_SetDriver’);
if not FSOUND_Init(24000, 4, 0) then
Showmessage(’Error! Initializing ‘ + FMOD_ErrorString(FSOUND_GetError()));
then I load different songs depending on what entries are selected in a treenavview via:
case AIndexNav of
// ShowMessage(’Audio zugewiesen’);
FMODPlayer := FMusic_LoadSong('media\atomic.fsb'); if FMODPlayer = nil then begin MessageDlg('failed to load music', mtError, [mbOk], 0 ); exit; end; end;
then the Song is played and stopped by the following procedures
procedure TFrmMain.SpdBtnAudioPlayClick(Sender: TObject);
SpdBtnAudioPlay.Enabled := false;
SpdBtnAudioStop.Enabled := true;
Audioplaying := True;
procedure TFrmMain.SpdBtnAudioStopClick(Sender: TObject);
SpdBtnAudioPlay.Enabled := true;
SpdBtnAudioStop.Enabled := false;
AudioPlaying := False;
Only stopping won’t work.
I would be really thankful for any comments or help!
- Benjin answered 13 years ago
This is probably something in your code, either post it here, or better try ro find out what it is.
Try for example creating a plain simple program which loads a song and can be stoppen by pressing a button. No more.
If you don’t have the problem there, it is something in your code.
Please login first to submit.