Comments (4)
Sorry about the delay, Jonatan - Can you reproduce this with the TAAE sample app? I'm having trouble doing so, on iOS 7.0.3 on an iPad 3 WiFi and iPhone 5s.
from theamazingaudioengine.
Yes, at least part of the problem happens when I try to stop the audio engine if headphones are unplugged while app is in background. I can reproduce it in the sample app by adding the following to ViewControllers init:
[audioController addObserver:self
forKeyPath:@"playingThroughDeviceSpeaker"
options:0
context:NULL];
And add the following to the property observer:
if (object == _audioController && [keyPath isEqualToString:@"playingThroughDeviceSpeaker"]) {
if(_audioController.playingThroughDeviceSpeaker && [UIApplication sharedApplication].applicationState != UIApplicationStateActive) {
[_audioController stop];
}
}
The results:
2013-11-08 16:16:47.418 TheEngineSample[22712:60b] TAAE: Changed audio route to SpeakerAndMicrophone
2013-11-08 16:16:47.422 TheEngineSample[22712:60b] TAAE: Stopping Engine
2013-11-08 16:16:47.595 TheEngineSample[22712:60b] AEFloatConverter.m:76: AudioConverterNew result 1718449215 666D743F ?tmf
2013-11-08 16:16:47.599 TheEngineSample[22712:60b] AEFloatConverter.m:77: AudioConverterNew result 1718449215 666D743F ?tmf
2013-11-08 16:16:47.601 TheEngineSample[22712:60b] AEAudioController.m:2585: AudioConverterNew result 1718449215 666D743F fmt?
2013-11-08 16:16:47.603 TheEngineSample[22712:60b] AEAudioController.m:2586: AudioConverterSetProperty(kAudioConverterChannelMap result -50 FFFFFFCE ˇˇˇŒ
2013-11-08 16:16:47.617 TheEngineSample[22712:60b] TAAE: Input status updated (0 channel, non-interleaved)
2013-11-08 16:16:47.624 TheEngineSample[22712:60b] TAAE: Changed audio route to SpeakerAndMicrophone
However, it doesn't explain the errors I get when plugging in the headphones while in background. I can't see that I access anything else in the audioController in that case..
from theamazingaudioengine.
Update: Oh, when plugging in the headphones, the errors comes from Audiobus:
2013-11-08 16:21:36.136 AUFX Test[22719:60b] TAAE: Changed audio route to HeadphonesAndMicrophone
2013-11-08 16:21:36.143 AUFX Test[22719:60b] AEAudioController.m:2585: AudioConverterNew result 1718449215 666D743F fmt?
2013-11-08 16:21:36.147 AUFX Test[22719:60b] AEAudioController.m:2586: AudioConverterSetProperty(kAudioConverterChannelMap result -50 FFFFFFCE ˇˇˇŒ
2013-11-08 16:21:36.150 AUFX Test[22719:60b] /ABInputPort.m:243: AudioConverterNew result 1718449215 666D743F ?tmf
2013-11-08 16:21:36.152 AUFX Test[22719:60b] /ABInputPort.m:245: AudioConverterNew result 1718449215 666D743F ?tmf
2013-11-08 16:21:36.154 AUFX Test[22719:60b] TAAE: Input status updated (0 channel, non-interleaved)
But it's the same error so I'm quite sure it's related.
from theamazingaudioengine.
Another update: doing [_audioController performSelector:@selector(stop) withObject:nil afterDelay:10.0] instead of stopping directly when headphones are pulled works around the problem. It's either a timing issue or a threading issue (perhaps the observer is not called on the main thread?)
from theamazingaudioengine.
Related Issues (20)
- 1.5.7 not on Cocoapods HOT 2
- Open the dome,Bluetooth speakers will automatically stop working? HOT 1
- How can I set the preferredInput? Everytime I change it, it sets it back to previous.
- Stop doesn't work if the audioDescription preferred sampleRate is different than detected
- user AEAudioController Empty my control center
- Using play through channel ,but need to delay the playing
- Prepare and begin recording
- Is TheAmazingAudioEngine possible to perform audio synthesis?
- Can only record m4a type ? HOT 1
- 请问一下theamazingaudioengine 录音的时候如何过滤扬声器声音 HOT 2
- Hi, I need to create a visualizer like ZLHistogramAudioPlot. I try to use this code
- Create ZLHistogramAudioPlot like visualizer using TheAmazingAudioEngine
- React Native version?
- regionStartTime not work
- 可以绘制音波图吗
- Crash AEUtilities.h -[AEAudioController teardown] HOT 1
- demo 不清楚怎么使用的 可以讲一下吗
- Multiple samples not playing at the same time in iOS 14 HOT 5
- `AEAudioBufferListGetLength ()` has a incorrect implementation HOT 2
- How to export modified audio file?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from theamazingaudioengine.