Cocos2DXNA / cocos2d-xna

XNA Port of Cocos2d-X
www.cocos2dxna.com
227 stars 123 forks source link

Sounds not working anymore #424

Closed rpmobile closed 10 years ago

rpmobile commented 10 years ago

Grabbed latest commits (f541aa29c0). Ran tests project. Trying to play anything with CocosDension results in:

180: EXCEPTION thrown ('!dev'): -
ERROR:     >aqsrv> 65: Exception caught in (null) - error -1

AngryNinjas is broken in the same way, but I see more debug statements:

Failed to get buffer bits: Invalid Value, format=Stereo16, size=0, sampleRate=44100 [0:] 2014-05-31 09:48:37.770 AngryNinjas[3717:70b] Unexpected exception while playing a SoundEffect: Sounds/gong [0:] Unexpected exception while playing a SoundEffect: Sounds/gong [0:] 2014-05-31 09:48:37.771 AngryNinjas[3717:70b] Microsoft.Xna.Framework.Audio.InstancePlayLimitException: External exception at Microsoft.Xna.Framework.Audio.SoundEffectInstance.PlatformPlay () [0x00029] in /Users/rpmobile/Projects/cocos2d-xna/MonoGame/MonoGame.Framework/Audio/SoundEffectInstance.OpenAL.cs:223 at Microsoft.Xna.Framework.Audio.SoundEffectInstance.Play () [0x00036] in /Users/rpmobile/Projects/cocos2d-xna/MonoGame/MonoGame.Framework/Audio/SoundEffectInstance.cs:140 at Microsoft.Xna.Framework.Audio.SoundEffect.Play (Single volume, Single pitch, Single pan) [0x00035] in /Users/rpmobile/Projects/cocos2d-xna/MonoGame/MonoGame.Framework/Audio/SoundEffect.cs:187 at Microsoft.Xna.Framework.Audio.SoundEffect.Play () [0x00011] in /Users/rpmobile/Projects/cocos2d-xna/MonoGame/MonoGame.Framework/Audio/SoundEffect.cs:162 at CocosDenshion.CCEffectPlayer.Play (Boolean bLoop) [0x0005b] in /Users/rpmobile/Projects/cocos2d-xna/cocos2d/denshion/CCEffectPlayer.cs:82 at CocosDenshion.CCSimpleAudioEngine.PlayEffect (System.String pszFilePath, Boolean bLoop) [0x0003e] in /Users/rpmobile/Projects/cocos2d-xna/cocos2d/denshion/CCSimpleAudioEngine.cs:305

totallyeviljake commented 10 years ago

I built one of our production games on Android using the latest source and it played sound just fine. What platform are you using? the sounds in Angry Ninjas are recorded as stereo, which may be a problem too.

rpmobile commented 10 years ago

Sorry, should have clarified that this is iOS. I built from scratch, and no sound is working on any of the tests (CocosDension) or AngryNinjas.

All the sounds were working fine earlier this week, so it seems like something that cropped up with the last commit.

totallyeviljake commented 10 years ago

I did a full rebuild and re-install of Santa Shooter on an iPad 2. The sound worked fine.

Are you building sound using the MonoGame content builder? We use raw sound files - wav files - in SS. I suggest using raw sound files for your games.

rpmobile commented 10 years ago

After some digging, it looks like several issues:

I was not building sound with the content builder. It seems that I need a PC and Visual Studio for that. Will dust off my other machine and try to get that resolved.

Thanks for your help!

totallyeviljake commented 10 years ago

You can use the MonoGame content builder project to build content on the Mac. You do it via contentproject project files and the command line tool. From what I know, it works, but I have not used it yet. I still use XNA Studio 4r1 and a custom iOS build handler that Ray Batts wrote a year ago.

The Mic/Sound hardware problem you experienced is well known in the openGL world of MonoGame. Any time openAL can't get the hardware for sound playback it does strange things.

rpmobile commented 10 years ago

Ah, ok. Thanks a lot! Very helpful.