wxEVT_MEDIA_FINISHED doesn't work with mp3's

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
forrestcupp
Earned some good credits
Earned some good credits
Posts: 102
Joined: Thu Dec 28, 2006 5:12 pm
Location: Indiana, US

wxEVT_MEDIA_FINISHED doesn't work with mp3's

Post by forrestcupp » Thu Jul 02, 2009 2:40 am

I've connected a wxMediaCtrl to a Finished event where I play it again so it will loop. I used common code that everyone uses, and I've been really frustrated for a while because I couldn't get it to work. So I tried loading a .wav file instead of an mp3 and it worked perfectly without my needing to change any code.

So just in case it was a problem with that specific mp3, I tried loading other mp3's. None of them worked with the Finished event, but .wav's work just fine.

Has anyone had any success with getting an mp3 to call an EVT_MEDIA_FINISHED?

In my header:

Code: Select all

	void AmbienceEnd(wxMediaEvent& event);
	wxMediaCtrl* mAmbience;
In my frame constructor:

Code: Select all

	mAmbience = new wxMediaCtrl(panel, -1);
	mAmbience->Connect(wxEVT_MEDIA_FINISHED,
		wxMediaEventHandler(FlashcardFrame::AmbienceEnd), NULL, this);
	mAmbience->Load(wxT("res\\ambience.mp3"));
The OnFinished Function:

Code: Select all

void FlashcardFrame::AmbienceEnd(wxMediaEvent &event)
{
	SetStatusText(wxT("finished"));
	mAmbience->Play();
}
It works fine if I substitute a .wav file in.

Also, has anyone successfully gotten wxEVT_MEDIA_LOADED to work in Windows Vista? It doesn't work for me. I saw that someone said it works in XP but not Vista.

vdell
Moderator
Moderator
Posts: 536
Joined: Fri Jan 07, 2005 3:44 pm
Location: Finland
Contact:

Post by vdell » Thu Jul 02, 2009 6:08 pm

I have no knowledge about wxMediaCtrl but you might want to post a ticket to the wxWidgets Trac.
Visual C++ 9.0 / Windows XP Pro SP3 / wxWidgets 2.9.0 (SVN) | Colligere

forrestcupp
Earned some good credits
Earned some good credits
Posts: 102
Joined: Thu Dec 28, 2006 5:12 pm
Location: Indiana, US

Post by forrestcupp » Fri Jul 03, 2009 2:31 am

Thanks. I got the ticket filed.

Post Reply