Bug 18035 - AudioManager needs an int overload parameter
Summary: AudioManager needs an int overload parameter
Alias: None
Product: Android
Classification: Xamarin
Component: BCL Class Libraries ()
Version: 4.13.x
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
Depends on:
Reported: 2014-02-26 17:10 UTC by developer
Modified: 2014-02-26 17:43 UTC (History)
1 user (show)

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

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description developer 2014-02-26 17:10:30 UTC
Android.Media.AudioManager's playSoundEffect needs an int overload such as in original API.  See this:  http://developer.android.com/reference/android/media/AudioManager.html#playSoundEffect(int)

This is required for Glass GDK, which another enum over than the SoundEffect from Android.Media.  See this: https://developers.google.com/glass/develop/gdk/reference/com/google/android/glass/media/Sounds

The current Xamarin Android.Media.AudioManager's PlaySoundEffect only accepts Android.Media.SoundEffect which can be extended in C# because it is a enum.
Comment 1 Jonathan Pryor 2014-02-26 17:43:27 UTC
It's "just" an enum, so you can cast "invalid" values to the enum type and it'll work:

    var v = unchecked((SoundEffect) 0xdeadbeef); // valid!

Thus, aside from the need to cast new values, it shouldn't hinder your use of the APIs:

    partial class Sounds {
        public const SoundEffect Disallowed = (SoundEffect) 42; // or whatever
        // ...
    audio.PlaySoundEffect (Sounds.Disallowed);