开发者

Can't adjust volume on iOS4 using AudioToolbox/AudioServices.h

I am unable to adjust volume of sounds in my app when testing on new iPhone 4 (tried two devices) it works on an iPad and my colleague just told me that on 3Gs with iOS 4 the volume goes down when trying t开发者_StackOverflowo increase ... that's something doesn't make sense at all.

I am using AudioToolbox/AudioServices.h to just play short sounds in a game that are Wav format. It definitely looks like that the software version affects that a lot but I have no idea how to fix it ... anyone? :)

Thanks,

Ondrej


Hi I was having the same problem, I found out it's because I hadn't set the Session category:

NSError *setCategoryError = nil; 
[[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error: &setCategoryError]; 

if (setCategoryError) { //handle error } 

you can find out more about sessions Here: http://developer.apple.com/library/ios/#documentation/Audio/Conceptual/AudioSessionProgrammingGuide/Cookbook/Cookbook.html#//apple_ref/doc/uid/TP40007875-CH6-SW6

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜