Questions tagged [audiosession]

An audio session is a group of related audio streams.

An audio session contains either rendering streams or capture streams, but not both. By default, the volume and mute settings for a rendering session are persistent across system restarts. The volume and mute settings for a capture session are not persistent. A session that contains streams that operate in loopback mode is treated the same as a capture session.

80 questions
22
votes
1 answer

MPMoviePlayerController and AVAudioPlayer audio mixing glitch

I'm developing an interactive storybook type application for the iPhone and I've recently encountered a frustrating bug concerning audio mixing on the device. Firstly, I setup an audio session. I set the category to AVAudioSessionCategoryAmbient and…
20
votes
2 answers

Detect (listen to) audio route change in iOS 7

Just starting development for iOS 7, and found that AudioSession related functions and PropertyListeners are deprecated in iOS 7. Before I use the following method to detect if a headset has been plugged in or unplugged from the device: /* add…
Pei Xiang
  • 487
  • 4
  • 18
17
votes
3 answers

how to find out if audio session is active in iOS

I'm using AudioSessionSetActive(true) and AudioSessionSetActive(false) for setting the AudioSession to true or false in my iOS app. At any point, I want to find out whether the session is active or not. Is there a way to do that?
Namratha
  • 15,910
  • 25
  • 86
  • 123
11
votes
6 answers

What kind of routes could I get back from kAudioSessionProperty_AudioRoute property?

Apple guy tried to be funny and wrote in the docs: ("Headphone," "Speaker," etc.) What kind of return values are possible in reality?
dontWatchMyProfile
  • 42,456
  • 49
  • 169
  • 255
9
votes
5 answers

AudioQueueStart fail -12985

I made a streaming music player and it works fine in the foreground. But in the background iOS4, it doesn't play the next song automatically. ( remote control works ) The reason is AudioQueueStart return -12985. I already check the audio session. it…
8
votes
5 answers

PlaySystemSound with mute switch on

I know, I have to set the AudioSession to the 'playback' category, which allows audio even when the mute switch is on. This is what I do, but sound still gets muted when switch is on. UInt32 sessionCategory = kAudioSessionCategory_MediaPlayback; …
samvermette
  • 39,555
  • 25
  • 108
  • 143
7
votes
2 answers

Return volume control to iOS device ringer after playback ends

I have an audio app that uses the Media Playback audio session category to allow background audio. Once my audio session is initialized, the hardware volume buttons on the iOS device control the volume of my audio session. Once audio playback…
Seth McFarland
  • 251
  • 1
  • 6
7
votes
3 answers

How to detect if a bluetooth headset plugged or not IOS 8?

In my project, I use AVAudioSession to detect any headphone is plugged or unplugged. But in this case, I can't detect when bluetooth device is plugged. Here is my code for headphone state. -…
7
votes
1 answer

ios 7 non deprecated solution to resuming background music from duck

I am able to duck my background audio while playing new sounds. However I am unable to resume the background audio level to maximum again. When my delegate tries to "unduck" it just keeps being ducked. The normal fix for this is…
aZtraL-EnForceR
  • 1,744
  • 2
  • 16
  • 19
6
votes
2 answers

iOS: Using Bluetooth audio output (kAudioSessionProperty_OverrideCategoryEnableBluetoothInput) AudioSession

I have several questions to the CoreAudio AudioSession framework related to several Bluetooth tasks and I hope someone can help me with these issues or at least can confirm my latest findings. The usecase is a navigation app that wants to connect…
Alathink
  • 263
  • 1
  • 3
  • 11
5
votes
0 answers

How can I determine which Windows process is the "audio session" governing the current process's output?

I happen to be using Python bindings here, but I suspect that the problem, and the eventual answer, are not Python-specific. On Windows 10, using Python bindings to Windows' Core Audio library, specifically via pycaw.AudioUtilities.GetAllSessions(),…
jez
  • 12,803
  • 2
  • 30
  • 54
5
votes
3 answers

Routing iPhone Audio Sound

I have an app which does listen and play sound at the same time. By default, the sound output goes through the earphone. So I use the following code to route it through the speaker: UInt32 audioRouteOverride =…
ChrisB
  • 1,939
  • 2
  • 17
  • 22
5
votes
0 answers

Can I run two audio sessions simultaneously?

I use AVCamCaptureManager class from AVFoundation framework. At the same time I want to use volume up button to take a picture. As I understood, the only possible solution nowadays is to use audio session (turn it on and listen to changes in…
4
votes
1 answer

Playing music when application is in background with kAudioSessionCategory_SoloAmbientSound

I want to play music when my application is in the background, so I've set "audio background mode" in my app's info.plist. I want to set the audiosession's category to kAudioSessionCategory_SoloAmbientSound, because I want to respect the mute…
stoflow
  • 163
  • 1
  • 10
4
votes
1 answer

AVAudioSession - catching setMode and setCategory errors

I'm using AVAudioSession in an app that only performs audio playback. I'm setting my audioSession's mode and category in applicationDidFinishLaunchingWithOptions:. let audioSession = AVAudioSession.sharedInstance() do { try…
1
2 3 4 5 6