This is fixed in svn and (AFAIK) in 1.2.5: http://bugzilla.ximian.com/show_bug.cgi?id=81867
Simple "player.Play()" does not throw an exception because the code is executed asynchronously. On 8/11/07, Markus Kilås <[EMAIL PROTECTED]> wrote: > I maid some more tries and found out that the current version from SVN > is working. > > I was confused because I got different results when using Mono 1.2.4 > installed from Gentoo portage and the one I downloaded and compiled > myself. In the first case I did not get any > NotImplementedException("from uri") just silence. > > > Alan McGovern skrev: > > File a bug report on bugzilla about the issue. I'm the one who coded in > > that support, and as far as i can tell, it should work fine. I need a > > reproduceable testcase. > > > > The actual code is here: > > http://anonsvn.mono-project.com/viewcvs/trunk/mcs/class/System/System.Media/SoundPlayer.cs?rev=81519&view=markup > > <http://anonsvn.mono-project.com/viewcvs/trunk/mcs/class/System/System.Media/SoundPlayer.cs?rev=81519&view=markup> > > > > As you can see, when Play() is called, it enters the LoadFromUri method, > > which then checks to see if the file exists on your HD and if so, > > creates a filestream. This shouldn't fail, yet by the looks of it, it is. > > > > Alan. > > > > On 8/9/07, *Markus Kilås* <[EMAIL PROTECTED] > > <mailto:[EMAIL PROTECTED]>> wrote: > > > > 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 > > > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > > > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > > > www.markuspage.com <http://www.markuspage.com> > > > > > > _______________________________________________ > > > Mono-devel-list mailing list > > > Mono-devel-list@lists.ximian.com > > <mailto:Mono-devel-list@lists.ximian.com> > > > http://lists.ximian.com/mailman/listinfo/mono-devel-list > > > > > > > > > > > > > -- > > > > Markus Kilås > > > > +46(0)70 424 94 85 > > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > > www.markuspage.com <http://www.markuspage.com> > > _______________________________________________ > > Mono-devel-list mailing list > > Mono-devel-list@lists.ximian.com > > <mailto:Mono-devel-list@lists.ximian.com> > > http://lists.ximian.com/mailman/listinfo/mono-devel-list > > > > > > -- > > Markus Kilås > > +46(0)70 424 94 85 > [EMAIL PROTECTED] > [EMAIL PROTECTED] > www.markuspage.com > _______________________________________________ > Mono-devel-list mailing list > Mono-devel-list@lists.ximian.com > http://lists.ximian.com/mailman/listinfo/mono-devel-list > -- MS-DOS user since 5.0 Windows user since 3.11 Linux user since kernel 2.4 Novell Netware user since 2.2 WARCRAFT user since 1.0 _______________________________________________ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list