Bug 32883 - System.Media.SoundPlayer does not play sound
Summary: System.Media.SoundPlayer does not play sound
Status: CONFIRMED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System (show other bugs)
Version: 4.2.0 (C6)
Hardware: PC Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-08-07 15:46 UTC by Cody Beyer (MSFT)
Modified: 2016-03-08 20:15 UTC (History)
7 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description Cody Beyer (MSFT) 2015-08-07 15:46:53 UTC
### Description

Using the Xamarin.Mac .NET 4.5 Framework, System.Media.SoundPlayer does not play any sound

### Sample

https://www.dropbox.com/s/2rt66rhgklj02ey/PlaySound.zip?dl=0

### Steps to Reproduce

1. Download sample
2. Run
3. Enter path to sound file in text box
4. Click button

### Expected Results

The sound file will play

### Actual Results

The sound file does not play

### Version

=== Xamarin Studio ===

Version 5.9.5 (build 9)
Installation UUID: 14e9db9d-4a59-440f-8c5b-890f54ec8c58
Runtime:
	Mono 4.0.3 ((detached/d6946b4)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400030020

=== Apple Developer Tools ===

Xcode 6.4 (7720)
Build 6E35b

=== Xamarin.iOS ===

Version: 8.10.4.46 (Business Edition)
Hash: 2c66d2f
Branch: master
Build date: 2015-08-04 13:52:25-0400

=== Xamarin.Android ===

Version: 5.1.5.3 (Business Edition)
Android SDK: /Users/codybeyer/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
		5.0   (API level 21)
Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

=== Xamarin Android Player ===

Version: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Xamarin.Mac ===

Version: 2.0.2.111 (Business Edition)

=== Build Information ===

Release ID: 509050009
Git revision: b99cb19a1d3b15d8980c4616f13f837457e5b292
Build date: 2015-07-28 02:01:44-04
Xamarin addins: d53d6eceb828422f3d4aff8547f2f6bab6c9ea58

=== Operating System ===

Mac OS X 10.10.4
Darwin Codys-Macintosh.router 14.4.0 Darwin Kernel Version 14.4.0
    Thu May 28 11:35:04 PDT 2015
    root:xnu-2782.30.5~1/RELEASE_X86_64 x86_64
Comment 1 Ram Chandra 2015-08-10 06:43:14 UTC
I have checked this issue and also getting the reported behavior.

IDE logs: https://gist.github.com/RamChBachkheti/c8ff393b6690c2f6d02c

Environment Info:

=== Xamarin Studio ===

Version 5.9.5 (build 9)
Installation UUID: 6ea47b0d-1852-4aaf-808d-373ff0a5002b
Runtime:
	Mono 4.0.3 ((detached/d6946b4)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400030020

=== Xamarin.Android ===

Version: 5.1.3.1 (Business Edition)
Android SDK: /Users/jatin66/Desktop/Backup/android-sdk-macosx
	Supported Android versions:
		2.3    (API level 10)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Xamarin Android Player ===

Version: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Apple Developer Tools ===

Xcode 6.4 (7720)
Build 6E35b

=== Xamarin.iOS ===

Version: 8.10.4.49 (Business Edition)
Hash: 7e598ef
Branch: master
Build date: 2015-08-08 12:28:27-0400

=== Xamarin.Mac ===

Version: 2.0.2.125 (Business Edition)

=== Build Information ===

Release ID: 509050009
Git revision: b99cb19a1d3b15d8980c4616f13f837457e5b292
Build date: 2015-07-28 02:01:44-04
Xamarin addins: d53d6eceb828422f3d4aff8547f2f6bab6c9ea58

=== Operating System ===

Mac OS X 10.10.3
Darwin Dalvik.local 14.3.0 Darwin Kernel Version 14.3.0
    Mon Mar 23 11:59:05 PDT 2015
    root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64
Comment 2 Chris Hamons 2015-10-06 17:15:46 UTC
This appears to be a mono issue. The following doesn't even work in a console application:

			SystemSound s = SystemSounds.Beep;
			s.Play ();
			SoundPlayer player = new SoundPlayer ();
			player.SoundLocation = "/Users/donblas/Downloads/M1F1-Alaw-AFsp.wav";
			player.Load ();
			player.PlaySync ();
Comment 3 Rodrigo Kumpera 2015-10-06 18:11:35 UTC
Hey guys,

Is there a customer hitting this issue?

This was never implemented on OSX and we plan on keeping it that way.

Our customers should be able to get around this limitation by using the native API equivalent.
Comment 8 Rainer Mager 2015-12-23 08:30:27 UTC
I'm running into this issue too. Requiring use of the native API means we need to write more platform specific code and can rely less on platform independent .Net code.
Comment 9 Rainer Mager 2015-12-23 08:31:03 UTC
Oh, if this isn't implemented then it should throw a NotImplementedException instead of failing silently.
Comment 10 Hrvoje 2016-03-08 20:15:30 UTC
Even SystemSounds.Beep.Play (); doesn't work.
After couple of calls to beep method it throws an error.
Need that beep!

Using Linux

Note You need to log in before you can comment on or make changes to this bug.