[Mono-bugs] [Bug 81867][Wis] New - [PATCH] System.Media.SoundPlayer fails to load sound files

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Jun 13 04:33:27 EDT 2007


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by skolima at gmail.com.

http://bugzilla.ximian.com/show_bug.cgi?id=81867

--- shadow/81867	2007-06-13 04:33:27.000000000 -0400
+++ shadow/81867.tmp.14052	2007-06-13 04:33:27.000000000 -0400
@@ -0,0 +1,49 @@
+Bug#: 81867
+Product: Mono: Class Libraries
+Version: 1.2
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: System
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: skolima at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: [PATCH] System.Media.SoundPlayer fails to load sound files
+
+Description of Problem:
+SoundPlayer is only able to play WAVE from Stream input. It is trival to
+extend this to support playing from file input.
+
+Steps to reproduce the problem:
+1. Try this program:
+
+using (SoundPlayer sp = new SoundPlayer(new FileStream("Asterisk.wav",
+FileMode.Open)))
+	sp.PlaySync();
+
+using (SoundPlayer sp = new SoundPlayer("Asterisk.wav"))
+	sp.PlaySync();
+
+Actual Results:
+
+First call will succeed, second will fail with NotImplementedException.
+
+Expected Results:
+Both calls play the same file.
+
+How often does this happen? 
+Always.
+
+Additional Information:
+
+Fix is to change the line 95 in SoundPlayer from throwing the exception to:
+
+using (FileStream fs = new System.IO.FileStream (sound_location,
+System.IO.FileMode.Open))
+	LoadFromStream (fs);


More information about the mono-bugs mailing list