How do I play a sound effect from the Glass GDK?

The Glass GDK adds some constants for playing additional sound effects (see: https://developers.google.com/glass/develop/gdk/reference/com/google/android/glass/media/Sounds). For example (in Java):

AudioManager audio = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
audio.playSoundEffect(Sounds.SUCCESS);

How can I get this to work in C#? Here is as far as I can get:

AudioManager audio = (AudioManager)this.GetSystemService(Context.AudioService);
audio.PlaySoundEffect(// takes a SoundEffect enum value, but Sounds.Success is an int

Posts

  • EBurchettEBurchett USMember

    I have the same problem. the SoundEffect enum is sealed so couldn't even inherit from SoundEffect and add them in.

    It is bug.

    PlaySoundEffect should be overloaded to take an int.

Sign In or Register to comment.