AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Multimedia Delphi Problem mit FMODs FMUSIC_StopSong()
Thema durchsuchen
Ansicht
Themen-Optionen

Problem mit FMODs FMUSIC_StopSong()

Ein Thema von Benjin · begonnen am 25. Mär 2005 · letzter Beitrag vom 2. Apr 2005
 
Benjin

Registriert seit: 1. Nov 2004
Ort: München
64 Beiträge
 
Delphi 7 Enterprise
 
#1

Problem mit FMODs FMUSIC_StopSong()

  Alt 25. Mär 2005, 15:32
Hallo, bei mir wll FMUSIC_StopSong() einfach nicht funktionieren. Es gibt keine Fehlermeldung oder sonstiges, es passiert beim klicken auf den entsprechenden Button einfach nichts.
Ich benutze fsb Dateien, die jeweils eine mp3 Datei enthalten und auch ohne Probleme abgespielt werden.

Ich habe das Problem bereits im FMOD Forum gepostet, deswegen hier einfach ein repost des Problems und des Sourcecodes:

Zitat:
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:

Delphi-Quellcode:

var

FMODPlayer: PFMusicModule;



On FormCreate I do

Delphi-Quellcode:

  FMOD_Load(nil);
  InitAudio;
InitAudio looks like this:

Delphi-Quellcode:

procedure TFrmMain.InitAudio;
begin
if FMOD_VERSION > FSOUND_GetVersion then
    begin
      Showmessage('Error: falsche Version');
      Exit;
    end;

//Sets up the soundsystem output mode.
  if not FSOUND_SetOutput(FSOUND_OUTPUT_WINMM) then
    begin
      Showmessage('Error: Fehler bei FSOUND_SetOutput');
      Exit;
    end;

  if not FSOUND_SetDriver(0) then
    begin
      Showmessage('Error: Fehler bei FSOUND_SetDriver');
      Exit;
    end;

  if not FSOUND_Init(24000, 4, 0) then
    begin
      Showmessage('Error! Initializing ' + FMOD_ErrorString(FSOUND_GetError()));
      Exit;
    end;
end;
then I load different songs depending on what entries are selected in a treenavview via:

Delphi-Quellcode:

case AIndexNav of

  2: begin
// 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


Delphi-Quellcode:

procedure TFrmMain.SpdBtnAudioPlayClick(Sender: TObject);
begin

FMusic_PlaySong(FMODPlayer);


SpdBtnAudioPlay.Enabled := false;
SpdBtnAudioStop.Enabled := true;

Audioplaying := True;

end;

procedure TFrmMain.SpdBtnAudioStopClick(Sender: TObject);
begin
SpdBtnAudioPlay.Enabled := true;
SpdBtnAudioStop.Enabled := false;
AudioPlaying := False;
FMUSIC_StopSong(FMODPlayer);
SetAudioFile;

end;
Only stopping won't work.


I would be really thankful for any comments or help!

Weiß da jemand Rat?
..... - Kurt - .....
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 21:24 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz