GNOME Bugzilla – Bug 470881
replace System.MediaSounds on windows Mono
Last modified: 2009-03-02 16:33:56 UTC
System.MediaSounds works on windows with .net and on Linux with mono, but not on windows mono because it's dependendat on Alsa, libasound http://lists.ximian.com/pipermail/mono-list/2007-August/036050.html try to do it in other way, probably like this: [DllImport ("winmm.dll", SetLastError = true)] static extern bool PlaySound (string pszSound, IntPtr hmod, int fdwSound); public void PlayFinishedSound () { string sound = Application.ExecutablePath + @"\Sounds\finished.wav"; PlaySound (sound, IntPtr.Zero, 0); } from http://www.mono-project.com/Guide:_Porting_Winforms_Applications Check also this thread: http://www.mail-archive.com/mono-devel-list@lists.ximian.com/msg13642.html If it doesn't work, see how muine works
Provisionally, on windows we play a system bell now. Searching a way to play wavs or oggs or mp3s: http://www.mono-project.com/More_Sample_Code Phonic and Platano projects not found ... found this code for platano: http://svn.ndesk.org/platano/ check it later gst-sharp is not officially on mono windows. Let's see how other projects do: http://www.mono-project.com/Gstreamer muine does not work on windows This page shows a low-level audio-player (but code is not free, and it's difficult for me to do something similar) http://www.codeproject.com/cs/media/cswavplay.asp banshee is being ported to win: http://groups.google.com/group/mono-soc-2007/browse_thread/thread/d1d8510fb208bad/8d6774bc433eec0e?lnk=gst&q=banshee&rnum=1#8d6774bc433eec0e i downloaded: http://banshee32.svn.sourceforge.net/viewvc/banshee32/Banshee.Base/ but it runs on .NET but not mono here is the svn: http://banshee32.svn.sourceforge.net/viewvc/banshee32/ here: http://groups.google.com/group/mono-soc-2007/browse_thread/thread/d1d8510fb208bad/8d6774bc433eec0e?lnk=gst&q=banshee&rnum=1#8d6774bc433eec0e talks about "I implemented a DirectShow player backend. It was actually incredibly easy. There are still bugs to iron out, but it works! " let's find this backend
Asked to banshee mailing list: http://mail.gnome.org/archives/banshee-list/2007-December/thread.html
In banshee there are two solutions: 1.-"The engine backend is implemented directly against Windows Media Player, called Banshee.MediaEngine.WMP10. It’s cool to see that they were able to use the native platform engine for playback, but sadly the developer of Banshee is more interested in getting the current GStreamer engine to run under Windows as well." http://www.frankps.net/?p=250 2.-Here samples of the WMP10 sln and assemblyInfo.cs for windows http://www.koders.com/noncode/fid1AFF37C514A15230FFB99F798DDBF94E834B75E1.aspx http://www.koders.com/csharp/fid84AED1545DA85193FA02CE90EA71D00CAE1844C9.aspx 3.-Last svn seems only use the Gstreamer, but the WMP10 seems easier for a non-audio project like cronojump. On a july report, the SoC student said that Gstreamer solution is slower and probably choppy: "Gstreamer is slow on Windows. It's fine most of the time, but when the CPU gets hammered, the audio will become choppy. This doesn't happen when using DirectSound in similar situations. I don't know yet if it's a significant problem." http://themonkeysgrinder.blogspot.com/2007/07/end-of-july-status.html 4.-Here there's a bug solved for the gstreamer solution http://groups.google.com/group/mono-soc-2007/browse_thread/thread/64451bd5a9e821d6/138de4581b2cb040?lnk=gst&q=banshee#138de4581b2cb040 5.-On the svn there's the engine for direct sound: mkdir banshee_windows_port cd bansee_windows_port svn co http://svn.gnome.org/svn/banshee/branches/windows-port . ls banshee/src/Engines/ Banshee.MediaEngine.DirectSound Banshee.MediaEngine.GStreamer Engines.mds Makefile.am ls banshee/src/Engines/Banshee.MediaEngine.GStreamer/ Banshee.MediaEngine.GStreamer.csproj Banshee.MediaEngine.GStreamer.mdp GstPlayerEngine.cs Makefile.am ls banshee/src/Engines/Banshee.MediaEngine.DirectSound/ Banshee.MediaEngine.DirectSound.csproj DirectSoundPlayerEngine.cs Properties But there's no using of the directSound engine on current svn. 6.- Try to create a little sample of playing on windows with directsound in a mono app
Scott Peterson wrote (1) about creating a Mono.Media abstraction from the banshee gstreamer engine for being used easily by other mono apps. This was just what we need, and we encouraged Scott to release it (2) No more study of Banshee code until this Mono.Media is done and it's easily integrated on Chronojump. (1) http://mail.gnome.org/archives/banshee-list/2007-December/msg00025.html (2) http://mail.gnome.org/archives/banshee-list/2007-December/msg00029.html
http://banshee-project.org/Mono.Media
just a final check: http://mail.gnome.org/archives/chronojump-list/2008-November/msg00011.html and this will be solved