[Mono-dev] System.Media.SoundPlayer silent

Markus Kilås digital at markuspage.com
Thu Aug 9 17:39:41 EDT 2007


I found a solution:

SoundPlayer sp = new SoundPlayer(new
FileStream("/usr/share/sounds/gaum/send.wav", FileMode.Open,
FileAccess.Read, FileShare.Read));
sp.Play();

That one plays the sound but the construnctor taking a string does not.


Markus Kilås skrev:
> Hi,
> 
> I'm trying to play a wave-file using the System.Media.SoundPlayer class as in
> http://www.mono-project.com/Guide:_Porting_Winforms_Applications . 
> 
> But it will just not play any sound on Mono 1.2.4 in Gentoo or the VMware image with openSUSE 10.2:
> 
> SoundPlayer sp = new SoundPlayer ("/usr/share/sounds/gaim/send.wav");
> sp.Play ();
> 
> Using .NET on WinXP the following code works fine:
> 
> SoundPlayer sp = new SoundPlayer ("c:\\windows\\media\\tada.wav");
> sp.Play ();
> 
> 
> Anyone got the SoundPlayer class to work or know what is wrong?
> 
> -- 
>
> Markus Kilås
>
> +46(0)70 424 94 85 
> markus at markuspage.com
> kilas at kth.se
> www.markuspage.com
> 
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
> 
> 
> 

-- 

Markus Kilås

+46(0)70 424 94 85
markus at markuspage.com
kilas at kth.se
www.markuspage.com



More information about the Mono-devel-list mailing list