Error while playing Soundeffect

Hi there,

I was trying to play an soundFX by writing this code:

SoundEffect test;

test = Game1.Self.Content.Load(“Pages/5/Music/foguetinho”);
test.Play();

However, I am getting the following error message when i call the .Play() method:

throw new InstancePlayLimitException(); at the SoundEffectInstance class.

Does any one know how to fix this?
Thank you.

Sorry I can’t offer a solution but I also am getting this error. If anyone with any expertise could shed some light on this it would be much appreciated.

EDIT: To be clear, this is the first time this sound effect is being played.

I’ve spent a little bit of time digging into this. Still no solution, but here’s what I’ve found.

I’m testing this on iOS 8 Simulator both through Xamarin Build Host as well as by running from the mac in Xamarin Studio. I’ve tested this with the latest MonoGame.dlls from NuGet as well as building the latest MonoGame source code.

The error is occurring whenever a SoundEffectInstance is played or resumed, and the error occurs beccause the OpenAlSoundController does not initialize correctly. Specifically the error is in OpenSoundController which returns false.

The error I get in the output is as follows:

2014-12-12 08:39:47.158 iOSTest4[5654:324886] 08:39:47.157 ERROR:     98: Error '!obj' trying to fetch default input device's sample rate
2014-12-12 08:39:47.158 iOSTest4[5654:324886] 08:39:47.158 ERROR:     100: Error getting audio input device sample rate: '!obj'
2014-12-12 08:39:47.159 iOSTest4[5654:324886] 08:39:47.159 WARNING:   230: The input device is 0x0; '(null)'
2014-12-12 08:39:47.159 iOSTest4[5654:324886] 08:39:47.159 WARNING:   234: The output device is 0x26; 'AppleHDAEngineOutputDP:3,0,1,1:0:{2D4C-04D5-4B493234}'
2014-12-12 08:39:47.159 iOSTest4[5654:324886] 08:39:47.159 ERROR:     400: error '!obj'
2014-12-12 08:39:47.159 iOSTest4[5654:324831] 08:39:47.159 ERROR:     >aurioc> 806: failed: -10851 (enable 2, outf< 2 ch,  44100 Hz, Int16, inter> inf< 2 ch,      0 Hz, Int16, inter>)
2014-12-12 08:39:47.159 iOSTest4[5654:324867] 08:39:47.159 ERROR:     180: EXCEPTION thrown ('!dev'): -
2014-12-12 08:39:47.160 iOSTest4[5654:324867] 08:39:47.160 ERROR:     703: Can't make UISound Renderer
2014-12-12 08:42:39.190 iOSTest4[5654:324831] Could not open AL device - OpenAL Error: InvalidValue

The initialization of OpenAL seems to be unmanaged invokes so I can’t debug any deeper than this.

Anyone else have ideas or insight on this problem?

Sorry for bumping this but it’s a really high priority issue for me - so much so that I’m willing to put my money where my mouth is. I’d be willing to pay $$ to anyone who could fix this. PM me if interested.

Update for future readers: This seems to be only happening on my simulator (iOS8), but runs fine on my phone (iPhone 4s on iOS 7.x). I’ll be posting additional info here as I figure out more.

Again for future readers: The problem I was experiencing was on a brand new mac which for some reason cannot play any sounds, whether in a monogame app running in a simulator or otherwise. The error message is archaic but ultimately it’s not a MonoGame bug. Now to figure out why audio on this mac doesn’t “just work”.

1 Like