Post marked as solved
228
Views
I have an ARKit app that plays sounds using playaudio
let audioPlay = SCNAction.playAudio(audioSource!, waitForCompletion: false)
when the app moves to the background i get the following :
AURemoteIO.cpp:1590:Start: AUIOClientStartIO failed (561015905)
AVAEInternal.h:109 [AVAudioEngineGraph.mm:1544:Start: (err = PerformCommand(*ioNode, kAUStartIO, NULL, 0)): error 561015905
when it comes back to the foreground and a sound is played it crashes and i get the following:
[avae] AVAEInternal.h:76 required condition is false: [AVAudioPlayerNode.mm:712:ScheduleBuffer: (outputFormat.channelCount == buffer.format.channelCount)]
in crash logs the crash is happening here :
AVAudioFileImpl::CheckClientFormatSet() + 60
tried fixes: Enable background audio works but my app does not have any logical use for background audio
self.sceneView.audioEngine.mainMixerNode.outputVolume = 0.0 when app moves to background. still crashes but less often
Any help would be appreciated.
Post marked as unsolved
183
Views
here is how i add an audio player to a SCNNodelet audioSource = SCNAudioSource(fileNamed: nodeName)
audioSource?.volume = 1
audioSource?.loops = true
audioSource?.load()
audioSource?.isPositional = true
let audioPlayer = SCNAudioPlayer(source: audioSource!)
node.addAudioPlayer(audioPlayer)i try to pause the audioPlayer but it doesn'taudioPlayer.audioNode?.engine?.pause()I am trying to pause the audioPlayer because when Replaykit's alert appears (user permission) it pauses my AR scene but not my audioplayers so the sounds are out of sync with the SCNNode when the alert is dismissed. any idea on how i can pause a SCNAudioPlayer ?thanks
Post marked as unsolved
442
Views
Hello,The output video freezes for the first few seconds, this happens around 40% of screen recording. Sometimes it happens the first time i record, but in general the freeze is very random. I tested my code on all iOS 9+ and different devices.I am using cocos2d.here is my code:(RPScreenRecorder* recorder) global variable
recorder=nil;
recorder = RPScreenRecorder.sharedRecorder;
recorder.delegate=self;To start Recordingrecorder.microphoneEnabled=NO;
[recorder startRecordingWithHandler:^(NSError *error){
if(error)
{
......
}
else
{
Start animations....
}
}];To stop Recording-(void)StopRecording
{
[recorder stopRecordingWithHandler:^(RPPreviewViewController * previewViewController,
NSError * error) {
if(previewViewController)
{
[self.delegate StopedRecording];
previewViewController.previewControllerDelegate = self;
previewViewController.modalPresentationStyle = UIModalPresentationCurrentContext;
[[CCDirector sharedDirector] presentViewController:previewViewController animated:YES completion:nil];
}
if(error)
{
.....
}
}];
}
- (void)previewControllerDidFinish:(RPPreviewViewController *)previewController
{
[[CCDirector sharedDirector] dismissViewControllerAnimated:YES completion:nil];
....
}
- (void)screenRecorder:(RPScreenRecorder *)screenRecorder didStopRecordingWithError:(NSError *)error previewViewController:(nullable RPPreviewViewController *)previewViewController;
{
...
}i use Open AL for sound output. The sound doesn't freeze.Any suggestions?