avaudiosession

Low recording volume in combination with AVAudioSessionCategoryPlayAndRecord

家住魔仙堡 提交于 2019-11-26 19:21:08
问题 When I set: [[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayAndRecord error:NULL]; …recording and playing works fine, just the playback volume is around 60% lower than when I would just play the same sound without recording and settings PlayAndRecord. I need to get high volume peaks (to check if a user blow in the mic) for that i started a recording session. But without settings AVAudio..PlayandRecord, i can not playback any sounds in the meantime. Thats the reason i

How Do I Route Audio to Speaker without using AudioSessionSetProperty?

拜拜、爱过 提交于 2019-11-26 18:39:17
As AudioSessionSetProperty may become deprecated , I'm trying to find an code example of how to route audio to the speaker using other means. Previously I did the following: -(void)setSpeakerEnabled { debugLog(@"%s",__FUNCTION__); UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker; AudioSessionSetProperty ( kAudioSessionProperty_OverrideAudioRoute, sizeof (audioRouteOverride), &audioRouteOverride ); } Trying to get same result but without call to AudioSessionSetProperty . foundry On each release of iOS, more of the audioSession properties are migrated to AVFoundation, so you

AVCaptureSession and background audio iOS 7

廉价感情. 提交于 2019-11-26 09:37:43
问题 Whenever I start an AVCaptureSession running with the microphone as an input it cancels whatever background music is currently running (iPod music for instance). If I comment out the line adding the audio input, the background audio continues. Does anyone know a way to record video clips with the microphone while continuing to allow background audio to play? Also there is error, when you trying to record video and the music is currently playing. A tried to do like this: [[AVAudioSession

Are headphones plugged in? iOS7

自古美人都是妖i 提交于 2019-11-26 08:45:27
问题 Developing an app for an iPhone with audio files that need to be listened too through headphones. How do I check if headphones aren\'t plugged in so I can tell the user to plug in headphones. I have the following code from another thread but the audioSessionGetProperty method is deprecated. Anyone know how to alter the following code to make this work OR have there own code/solution. Thanks. - (BOOL)isHeadsetPluggedIn { UInt32 routeSize = sizeof (CFStringRef); CFStringRef route; //Maybe

How Do I Route Audio to Speaker without using AudioSessionSetProperty?

◇◆丶佛笑我妖孽 提交于 2019-11-26 06:29:19
问题 As AudioSessionSetProperty may become deprecated , I\'m trying to find an code example of how to route audio to the speaker using other means. Previously I did the following: -(void)setSpeakerEnabled { debugLog(@\"%s\",__FUNCTION__); UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker; AudioSessionSetProperty ( kAudioSessionProperty_OverrideAudioRoute, sizeof (audioRouteOverride), &audioRouteOverride ); } Trying to get same result but without call to AudioSessionSetProperty .

How to programmatically sense the iPhone mute switch?

こ雲淡風輕ζ 提交于 2019-11-26 03:24:10
问题 I can\'t seem to find in the SDK how to programatically sense the mute button/switch on the iPhone. When my app plays background music, it responds properly to the volume button without me having any code to follow that but, when I use the mute switch, it just keeps playing away. How do I test the position of mute? (NOTE: My program has its own mute switch, but I\'d like the physical switch to override that.) 回答1: Thanks, JPM. Indeed, the link you provide leads to the correct answer

Detecting the iPhone's Ring / Silent / Mute switch using AVAudioPlayer not working?

送分小仙女□ 提交于 2019-11-26 02:51:42
问题 I\'ve tried using these methods in an attempt to detect that the Ring/Silent switch is active or not: How to programmatically sense the iPhone mute switch? AVAudioSession category not working as documentation dictates But on my iPhone 4, the \"state\" value is always \"Speaker\" (and the length value returned by CFStringGetLength(state) is always 7). Has anyone used this method successfully? If so, on what kind of device and SDK version? I\'m calling it like so: - (BOOL)deviceIsSilenced {

How to programmatically sense the iPhone mute switch?

断了今生、忘了曾经 提交于 2019-11-25 20:38:35
I can't seem to find in the SDK how to programatically sense the mute button/switch on the iPhone. When my app plays background music, it responds properly to the volume button without me having any code to follow that but, when I use the mute switch, it just keeps playing away. How do I test the position of mute? (NOTE: My program has its own mute switch, but I'd like the physical switch to override that.) Thanks, JPM. Indeed, the link you provide leads to the correct answer (eventually. ;) For completeness (because S.O. should be a source of QUICK answers! )... // "Ambient" makes it respect