Questions tagged [avaudioengine]

Use this tag when your question is about the AVAudioEngine class, which is part of the AVFoundation framework.

AVAudioEngine is part of the AVFoundation framework for Apple platforms. The class provides some of the more complex audio processing functionalities within the framework, by grouping together connected audio node objects that provide functionality for creating and processing audio signals and IO.

The AVAudioEngine API can be found here.

Related tags:

449 questions
5
votes
0 answers

AVAudioEngine crashing on sample rate in Swift

I have started getting a crash that did not previously happen with initialization of recording with the error: [avae] AVAEInternal.h:70:_AVAE_Check: required condition is false: [AVAudioIONodeImpl.mm:911:SetOutputFormat: (format.sampleRate ==…
user6631314
  • 1,475
  • 7
  • 21
5
votes
2 answers

AVAudioEngine synchronization for MIDI playback and recording

Question 1 My first question concerns playback synchronization when using an AVAudioPlayerNode and an AVAudioSequencer for MIDI. Basically I'm trying to play something over MIDI, but they need to be perfectly synchronized. I'm aware there are sync…
funct7
  • 2,849
  • 2
  • 22
  • 29
5
votes
1 answer

Capture audio samples with specific Sample Rate like Android in iOS Swift

I am a beginner in working with sounds and AVAudioEngine in IOS, and I'm developing an application that captures the audio samples as buffer and analyze it. Furthermore, the sample rate must be 8000 kHz and also must be encoded as PCM16Bit, but the…
Mohamed Salah
  • 465
  • 12
  • 25
5
votes
1 answer

how to record and play with AVAudioEngine with 8000 PCM format?

I want to use this code for VoIP service. i'm using web-socket and sending with it: let data = self.toNSData(PCMBuffer: buffer) and playback:let audioBuffer = self.toPCMBuffer(data: data) in another device) I'm used:…
ehsan
  • 61
  • 5
5
votes
1 answer

Crash when adding AKMicrophone

I'm developing an audio app with AudioKit which involves periodically stopping AudioKit, rearranging or replacing the chain of AKNode subclasses, then restarting AudioKit. This has been working smoothly until I tried it with AKMicrophone. If…
c_booth
  • 1,915
  • 1
  • 9
  • 15
5
votes
1 answer

AVAudioUnitSampler generates sinewaves after headphones route change, iOS 11 iPhone

I'm facing a strange issue on iPhone (iOS 11) when using AVAudioUnitSampler. Let's say I have a AVAudioUnitSampler initialised with a piano sound. So, every time that I connect or disconnect the headphones I hear the piano sound plus a sinewave tone…
Eloi Marin
  • 61
  • 2
5
votes
1 answer

AVAudioSession's PlayAndRecord category and AVAudioSessionModeMeasurement are incompatible with defaultToSpeaker option?

Attempting to put AVAudioSession into the .playAndRecord category with the AVAudioSessionModeMeasurement mode causes the .defaultToSpeaker option to be ignored, resulting in output being played quietly out the earpiece (also known as the receiver).
Warpling
  • 1,747
  • 2
  • 19
  • 32
5
votes
3 answers

How to search the error code of 'com.apple.coreaudio.avfaudio'?

Where could I get the information of com.apple.coreaudio.avfaudio error codes, such as: Terminating app due to uncaught exception 'com.apple.coreaudio.avfaudio', reason: 'error -50' I always get an error while writing PCM buffer to AVAudioFile.…
Edward_Sun
  • 81
  • 1
  • 6
5
votes
0 answers

AVAudioEngine warning: "deprecated Carbon Component Manager for hosting Audio Units"

I'm writing my first audio app for Mac, which loads an external audio unit and uses it to play sound through an instance of AVAudioEngine, and I've been seeing this warning: WARNING: 140: This application, or a library it uses, is using the …
man1
  • 2,009
  • 2
  • 15
  • 18
5
votes
1 answer

Custom AVAudioUnit with AVAudioEngine crashes on set provider block

I have the follow code block that should create an AVAudioNode that produces a sine wave, however it crashes on the line marked with a -[AUAudioUnitV2Bridge setOutputProvider:]: unrecognized selector sent to instance. Any ideas what might be…
Chris
  • 2,396
  • 4
  • 26
  • 47
5
votes
3 answers

AVAudioEngine downsample issue

I'm having an issue with downsampling audio taken from the microphone. I'm using AVAudioEngine to take samples from the microphone with the following code: assert(self.engine.inputNode != nil) let input = self.engine.inputNode! let audioFormat =…
nullforlife
  • 1,244
  • 1
  • 14
  • 29
5
votes
1 answer

save the audio file in the background

I have an app that changes the pitch of the audio when the pitch button is selected, now i am using installTapOnBus to save the file but this method gets invocated after i press the pitch button therefore only part of the audio is saved, i want to…
Rahul Patel
  • 1,802
  • 10
  • 21
5
votes
1 answer

AVAudioFile.length is 0 even if file exists

I'm creating an AVAudioFile for writing sound to a sound file. If the file already exists I want to move the framePosition to the end of the file, to continue writing at the end, instead of replacing the existing file. I did some tests, trying to…
andlin
  • 3,534
  • 3
  • 25
  • 43
5
votes
2 answers

Playing an audio file repeatedly with AVAudioEngine

I'm working on an iOS app with Swift and Xcode 6. What I would like to do is play an audio file using an AVAudioEngine, and until this point everything OK. But how can I play it without stopping, I mean, that when it ends playing it starts…
Guillermo Barreiro
  • 1,336
  • 1
  • 11
  • 13
4
votes
0 answers

AVAudioSession services reset when capturing input from bluetooth device that disconnects

TL;DR - AVAudioSession will fire AVAudioSessionMediaServicesWereLostNotification when a bluetooth port is specified with AVAudioSession.setPreferredInput and that device disconnects while actively reading input with either AVCaptureSession or…
bclymer
  • 6,260
  • 2
  • 23
  • 34