Ouya with latest MonoGame audio changes

From what I see in the code, the Ouya version of MonoGame will no longer compile due to API references that require API level 17. These are calls in the audio system that recently were updated. The Ouya runs on an API level of 16.

Specifically the follow code causes problems:

if (Android.OS.Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.JellyBeanMr1)

{

    Android.Util.Log.Debug("OAL", Game.Activity.PackageManager.HasSystemFeature(PackageManager.FeatureAudioLowLatency) ? "Supports low latency audio playback." : "Does not support low latency audio playback.");



    var audioManager = Game.Activity.GetSystemService(Context.AudioService) as AudioManager;

    if (audioManager != null)

    {

        var result = audioManager.GetProperty(AudioManager.PropertyOutputSampleRate);

        if (!string.IsNullOrEmpty(result))

            frequency = int.Parse(result, CultureInfo.InvariantCulture);

        result = audioManager.GetProperty(AudioManager.PropertyOutputFramesPerBuffer);

        if (!string.IsNullOrEmpty(result))

            updateSize = int.Parse(result, CultureInfo.InvariantCulture);

    }



    // If 4.4 or higher, then we don't need to double buffer on the application side.

    // See http://stackoverflow.com/a/15006327

    // Use the explicit value rather than a constant as the 4.2 SDK (the build SDK) does not define a constant for 4.4.

    if ((int)Android.OS.Build.VERSION.SdkInt >= 19)

    {

        updateBuffers = 1;

    }

}

where JellyBeanMr1, PropertyOutSamplerate, and PropertyOutputFramesPerBuffer are not defined in API level 16. I’ve worked around this by surrounding the above with a #if !OUYA check in my own code.

Has anyone else come across this issue? Is the above directive that bypasses the new audio code something that should be pushed to the repo?

Can you build using Target API level 17 but Minimum API level 16?

Seems to be fine but I can’t get my game to actually launch to make sure. It’s an unrelated issue though so I’ll make a new thread for that.

Edit:

Confirmed. Seems some default options in one of my projects were the cause of the issue. Went through all of them and set the target to 4.2 and set the startup projects to have a minimum of 4.1 and got it working.