hello, does anyone know how to play a midi file?
I want to play a .mid as the backgournd music of my application, but i have no idea about how to do it.... pls help me. thanks.
I tried to use wxMediaCtrl(with param: wxMEDIABACKEND_DIRECTSHOW) to play a midi, and it works. but..., there is a windows media player logo on my application. how can I hidden this logo, or is there any other ways to play midi without using quartz.dll (I mean, we must write a new midi decoder or not)? and as I know, we can use other decoder of the third party to finish it, e.g. libmpg123, an open source decoder.
ps: windows xp + C::B + wxWidgets + MinGW(gcc4.4.0)
how to play .mid file Topic is solved
As far as I know there is no cross-platform library for MIDI playback (and no capability inside wxWidgets itself), even though I may have missed something because when I was searching for MIDI librairies for my app (http://ariamaestosa.sf.net) I also wanted editing capabilities.
I ended up writing code for each supported platform
I ended up writing code for each supported platform
"Keyboard not detected. Press F1 to continue"
-- Windows
-- Windows
-
- Experienced Solver
- Posts: 80
- Joined: Wed May 26, 2010 8:42 am
- Location: Beijing, China
- Contact:
Thanks for yor reply, Auria.Auria wrote:As far as I know there is no cross-platform library for MIDI playback (and no capability inside wxWidgets itself), even though I may have missed something because when I was searching for MIDI librairies for my app (http://ariamaestosa.sf.net) I also wanted editing capabilities.
I ended up writing code for each supported platform
I used the wav file instead of midi file. therefore, I can use wxSound to play wav file, and it works fine.
btw: I can not play the wav file which is embedded in the resource.
Code: Select all
//in resource:
wav_test WAV ".\\res\\wav\\test.wav"
//code
wxSound* snd;
snd= wxSournd(wxT("wav_test"), true);
if(snd->IsOK()) // snd->IsOK returns true.
{ snd->Play();} //but there is no sound in fact.
my compiler is: MinGW(gcc4.4.0), may be 'windres.exe' does not support WAV in resource. i'm not sure about it. but if do not support wav, why does snd->IsOK return true...
- T-Rex
- Moderator
- Posts: 1249
- Joined: Sat Oct 23, 2004 9:58 am
- Location: Zaporizhzhya, Ukraine
- Contact:
There is wxMidi project. Maybe it will fit your needs. http://wxcode.sourceforge.net/showcomp.php?name=wxMidi
Note sure what kind of license you're using in your program, but you might want to check out FMod lib which is free for smaller projects.
http://www.fmod.org/ is cross-platform and supports many sound files and I've embedded it into a few wxGTK projects without issue so far.
http://www.fmod.org/ is cross-platform and supports many sound files and I've embedded it into a few wxGTK projects without issue so far.