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:

535 questions
3
votes
1 answer

iOS - AVAudioPlayerNode.play() execution is very slow

I'm using AVAudioEngine for audio in an iOS game application. A problem I've encountered is that AVAudioPlayerNode.play() takes a long time to execute, which can be a problem in real-time applications such as games. play() just activates the player…
scg
  • 449
  • 1
  • 3
  • 11
3
votes
0 answers

Speech recognition session crash

I know that similar questions already were asked but proposed solutions didn't help me. In my app I have to recognize user's speech and to synth text-to-speech as well. The problem is, I have random crashes when the app trying to recognize…
lithium
  • 1,272
  • 1
  • 14
  • 28
3
votes
1 answer

Redirect the output of an AVAudioEngine to the rendering block in an AUv3

I currently have an Xcode project that is based on an AVAudioEngine written in Swift. At the head of the engine is an AVAudioPlayerNode used to schedule some LPCM audio buffers. In order for an AUv3 to process the audio, it needs to override the…
cit
  • 2,465
  • 5
  • 28
  • 36
3
votes
1 answer

Dynamically reconnecting AVAudioEngine nodes without stopping sound

I'm trying to dynamically modify a graph of nodes in attached to an AVAudioEngine, but the graph outputs silence after every reconnection. In the below sample, I'd like to dynamically connect player to engine.mainMixerNode, but whenever I call…
Eric
  • 16,003
  • 15
  • 87
  • 139
3
votes
1 answer

AudioKit/AVAudioEngine Takes Too Long to Start

I'm using AudioKit, which uses AVAudioEngine underlyingly. I have built an average-sized audio chain with some players, a microphone, sound effects, and mixers to satisfy my app's functionality. However, I noticed that whenever I initialize the…
Nicholas
  • 747
  • 7
  • 23
3
votes
1 answer

How to change pitch and rate at same exact time with AVAudioEngine

I using AVAudioEngine to alter the pitch and rate of audio in Swift. I figured out how to change the speed/rate and keep the pitch the same, but when I do it there is a sort of audio glitch where you can hear the audio pitch adjusting very quickly…
spitchay
  • 89
  • 1
  • 10
3
votes
0 answers

Bad sound quality using AVAudioEngine for MPMediaItem

I'm trying to apply filters to sound taken from apple music library by using AVAudioEngine: First of all, I get AVAudioFile: NSURL *assetURL = [song valueForProperty:MPMediaItemPropertyAssetURL]; NSError *error; AVAudioFile *audioFile =…
Mateusz
  • 233
  • 3
  • 8
3
votes
1 answer

How to correctly set up AVAudioSession and AVAudioEngine when using both SFSpeechRecognizer and AVSpeechSythesizer

I am trying to create an app that leverages both STT (Speech to Text) and TTS (Text to Speech) at the same time. However, I am running into a couple of foggy issues and would appreciate your kind expertise. The app consists of a button at the center…
Jad Ghadry
  • 245
  • 2
  • 25
3
votes
0 answers

SFSpeechRecognizer 216 Error with Multiple Requests

I have an implementation of AVAudio and SFSpeechRecognizer that generally works fine the first few times. However, after one or more requests, I am getting a 216 Error. Despite numerous questions about what these errors, 216, 203 and others,…
user6631314
  • 1,751
  • 1
  • 13
  • 44
3
votes
1 answer

AVAudoPlayerNode to play a sound for a defined number of times

Is it possible in AVAudioPlayerNode to loop an audio sound for a number of times only instead of infinite times? The below code scheduled the audio for an infinite number of times instead of saying 5 times. aVAudioPlayerNode.scheduleBuffer(buffer!,…
Simant
  • 3,142
  • 4
  • 32
  • 61
3
votes
1 answer

How to convert AVAudioPCMBuffer to NSData in Objective-C?

As the title suggests. There is an old solution in Swift here. But I have hard time converting to Objective-C. Seems there is no Objective-C equivalent of UnsafeBufferPointer
Harikrishnan R
  • 150
  • 1
  • 12
3
votes
0 answers

AVAudioEngine in Xcode simulator shows no microphone input

The following code works on my iPhone 5, meaning it correctly "reads" the microphone. let input = audioEngine.inputNode let mixer = AVAudioMixerNode() audioEngine.attach(mixer) let format = AVAudioFormat(commonFormat:…
Simon Hessner
  • 1,757
  • 1
  • 22
  • 49
3
votes
1 answer

iOS/Swift: Record audio with 16khz on every hardware using AVAudioEngine

I need to record an audio signal from a microfone sampled with 16,000Hz. I am using AVAudioEngine and Swift: let input = audioEngine.inputNode let mixer = AVAudioMixerNode() audioEngine.attach(mixer) let format = AVAudioFormat(commonFormat:…
Simon Hessner
  • 1,757
  • 1
  • 22
  • 49
3
votes
1 answer

AVAudioEngine realtime frequency modulation

I would like to modify the incoming signal in realtime and send it to the iOS devices speakers. I've read that the AVAudioEngine can be used for such tasks. But can't find documentation or examples for what I would like to achieve. For testing…
Leo
  • 380
  • 1
  • 17
3
votes
1 answer

Converting AVAudioPCMBuffer to another AVAudioPCMBuffer

I am trying to convert a determined AVAudioPCMBuffer (44.1khz, 1ch, float32, not interleaved) to another AVAudioPCMBuffer (16khz, 1ch, int16, not interleaved) using AVAudioConverter and write it using AVAudioFile. My code uses the library AudioKit…
Pedro Paulo Amorim
  • 1,838
  • 2
  • 27
  • 50