FAQ Database Discussion Community

Does Media Player Framework need audio sessions to be managed?

I'd like to include a simple media player in my iOS 7+ app, and I've found some posts dealing with Media Player Framework and the MPMusicPlayerController, and I think that can meet my needs. However, I couldn't find the related documentation in Apple's docs, and instead I found that there...

session.setPreferredInput in Swift?

I am trying to set the preferred input to my AVAudioEngine. I have the following code: var iphoneInput: AVAudioSessionPortDescription = AVAudioSession.sharedInstance().availableInputs[0] as! AVAudioSessionPortDescription var error: NSError? session.setPreferredInput(inPort: iphoneInput, error: error) but Xcode keeps giving me errors for the last line stating taht it cannot invoke setPreferredinput with an arguement list...

AVPlayer (or AVAudioSession?) plays after I leave the ViewController, and when I return two are then playing

I have a viewController that streams audio from the web. When I leave that page of my app, the audio keeps playing (this is good). However, when I go back, the viewdidload method creates a second audioplayer. I can do this over and over until I have so many AVplayers....

AVAudioSession properties after Initializing AUGraph

To start a call, our VOIP app sets up an AVAudioSession, then builds, initializes and runs an AUGraph. During the call, we allow the user to switch back and forth between a speakerphone mode using code such as: avSession = [AVAudioSession sharedInstance]; AVAudioSessionCategoryOptions categoryOptions = [avSession categoryOptions]; categoryOptions |= AVAudioSessionCategoryOptionDefaultToSpeaker;...

Core Audio: Audio Unit to boost signal level

Our VOIP app uses both the Voice Processing IO Unit and the Remote IO Unit (we rebuild the AUGraph depending on which IO unit we require). We've noted that the audio output level is not as loud as some other VOIP apps such as Skype. Rather than manipulating the incoming...

How to change an iOS device volume programmatically?

Is there a way to change the device volume programmatically? maybe using audio session?

Monitor current dB level in Objective-C

I'm trying to display the decibel level of incoming sound via the iPhone microphone, everything works in the simulator, but does not work on an actual iOS device. It's like the iPhone is not detecting sound, here is my code: - (void)viewDidLoad { [[AVAudioSession sharedInstance] requestRecordPermission:^(BOOL granted) { if (granted)...

Stream radio from url with AVPlayer -> iPhone player controls not working

I use AVPlayer to stream a live sound from a url. It works perfectly except when my app is in background and I want to play or pause the iPhone player in the swipe-up menu (I dont know its exact name). The volume controls work, but not the play/pause controls....