avaudiosession

Check if Audio is playing in the App

人盡茶涼 提交于 2019-12-10 11:55:10
问题 I've been working on that for 3 hours already, and i can't find a solution to it. I am using a 3rd Party library, that plays a sound for me, I am guessing they are using AVAudioPlayer playSound, and i want to know, if there is a way to know if my app is playing a sound. I don't have access to the 3rd Party library, and the property to play that sound is private. I've been trying AVAudioSession, but there's only two different ways to check if there is any sound playing, and unfortunately it

AVAudioSession reactivation issue

Deadly 提交于 2019-12-10 10:52:44
问题 I am getting the following error: [0x19bf89310] AVAudioSession.mm:646: -[AVAudioSession setActive:withOptions:error:]: Deactivating an audio session that has running I/O. All I/O should be stopped or paused prior to deactivating the audio session. I have read through this post: iOS8 AVAudioSession setActive error however the solution there did not solve my problem. which is: small application (game) audio background music handled in AudioHelper.swift additional 'blip' sounds played with

Error from registration server when publishing audio unit

徘徊边缘 提交于 2019-12-10 09:31:58
问题 I'm trying to publish an AudioUnit generator on iOS. When I call - (void)publishOutputAudioUnit { AudioComponentDescription desc = { kAudioUnitType_RemoteGenerator, 'anap', 'cwcw', 0, 0 }; OSStatus status = AudioOutputUnitPublish(&desc, CFSTR("My app"), 1, m_au); if (status) { DLog(@"Couldn't publish audio unit"); } } I get the console message: ERROR: [0x39d1518c] 225: error -66748 from registration server with -66748 as the status. Google isn't helping me and neither are the docs. I'm

AVCaptureSession and AVAudioSession recording video while background music playing only works once

僤鯓⒐⒋嵵緔 提交于 2019-12-10 02:19:22
问题 After looking at this question: AVAudioSession AVAudioSessionCategoryPlayAndRecord glitch, i tried to take a stab at trying to get video recording with background music playing working correctly. I'm settling for the audio glitch when recording starts, and when it ends, and it works fine the first time the recording happens. But if I try to record again, the music will stop. Any ideas why? Here's a snippet of my code: captureSession = AVCaptureSession() captureSession?

Switching audio output between Receiver and Speaker in iOS7 and above?

好久不见. 提交于 2019-12-09 18:33:58
问题 I have an audio player which has an option of switching the Audio Output from Speaker to Receiver/Earpiece (irrespective of whether headset is connected) when proximity sensor notifies 1. The following is my code for doing so. - (void) switchAudioOutput:(NSString*)output{ AVAudioSession* audioSession = [AVAudioSession sharedInstance]; BOOL success; NSError* error; if([output isEqualToString:keAudioOutputReciever]){ //Force current audio out through reciever //set the audioSession override

Play system sound while recording video/audio

狂风中的少年 提交于 2019-12-09 13:28:03
问题 I'm trying to play a "beep" sound as required by apple when I start recording a video. I've found through SO and other sources that you can't play a sound while you have an audio input going without some configuration. Here's my attempt at the configuration method: private void SetupAudio() { beepSound = AssetBank.GetSystemSoundWav("video_record", "video_beep"); AudioSession.Initialize(); AudioSession.Interrupted += delegate { Console.WriteLine("Interrupted handler"); }; AudioSession.Category

IOS: Play sound while app in background

你说的曾经没有我的故事 提交于 2019-12-09 11:20:39
问题 I working on a little app where i want the phone to play a sound file on an event from my location controller. The problem is when the App is in Background mode the AVAudioPlayer not start the Audio file but the code is scheduled, getting NSLog output. Another thing is it works in the simulator but not on the phone. Whys not? This is my code to play the file: - (void)tryPlayTaleSound:(NSString*)fileName { NSString *backgroundMusicPath = [[NSBundle mainBundle] pathForResource:fileName ofType:@

Sounds in UILocalNotification louder than AVAudioPlayer at max volume

人走茶凉 提交于 2019-12-08 14:32:22
For purposes of this question, imagine my app plays an audio clip every 10 seconds. This audio plays/mixes with the iPod music player on the device (using ducking), using AVAudioPlayer. When the app is sent to the background, I schedule UILocalNotification objects with the audio file referenced (and no text), so the sounds continue to play at 10 second intervals. What is bothering me is that the volume of the audio clips played as part of a notification on iOS 6 seem to be twice as loud as the audio when I play in my app (and I'm setting the volume to 1.0f, which the docs say is max). So every

How to unduck AVAudioSession

最后都变了- 提交于 2019-12-08 09:48:23
问题 kAudioSessionProperty_OtherMixableAudioShouldDuck is used For audio session categories that allow mixing of iPod audio with application audio, specifies whether iPod audio should be reduced in level when your application produces sound. This property has a value of FALSE (0) by default. Set it to a nonzero value to turn on ducking. How can we unduck this? Is there any property? Thanks in advance, Chandra. 回答1: I had this same question and had trouble getting it to work consistently. I spent a

AvAudioSession won't work in iOS7?

匆匆过客 提交于 2019-12-08 06:26:04
问题 #import "SctreamAudioViewController.h" #import <AVFoundation/AVFoundation.h> #import "SecondViewController.h" @interface SctreamAudioViewController () @property (nonatomic, strong) AVPlayer *player; @end @implementation SctreamAudioViewController #define STREAM @"http://localhost/audio.mp3" - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. AVAudioSession *audioSession = [AVAudioSession sharedInstance]; [audioSession setCategory