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
4
votes
1 answer

AVAudioSession interruptions and route changes

I'm developing a game that includes an audio multitrack player running in the background. When dealing with pausing all tracks and then resuming when the pause button is pressed, I've found no significant difficulty: class AudioMultiTrack { var…
derekFairholm
  • 285
  • 1
  • 14
4
votes
1 answer

Stop recording after silence of X seconds

I am implementing following tutorial: Speech To Text I am recording audio using AVAudioEngine and using SFSpeechRecognizer to implement speech to text. Here the tutorial guides the speech to text using a button which starts and stop recording. I am…
Rocky Balboa
  • 784
  • 10
  • 25
4
votes
1 answer

How to use AVAudioNodeTapBlock in a tap in AVAudioEngine.

I am trying to install a tap on an AVAudioEngine. I have the current code: guard let engine = engine, let input = engine.inputNode else { print("error!") return } let format = input.inputFormat(forBus: 0) let…
FerasAS
  • 273
  • 2
  • 14
4
votes
1 answer

How do I subclass AVAudioUnit?

Since the way to instantiate an AVAudioUnit is this: [AVAudioUnit instantiateWithComponentDescription:componentDescription options:0 completionHandler:^(__kindof AVAudioUnit * _Nullable audioUnit, NSError * _Nullable error) { }]; How am I…
jeremywhuff
  • 2,911
  • 3
  • 29
  • 33
4
votes
1 answer

AVAudioFile doesn't play in AVAudioEngine

I'm attempting to play an AVAudioFile using the AVAudioEngine. The code is largely taken and adapted from the Apple Developer on-line videos, but there is no playback. Have spent some time going through the forums, but nothing seems to throw any…
aseago
  • 43
  • 4
4
votes
1 answer

fade in/out with AVAudioEngine

My app dynamically adds and removes nodes feeding the mainMixerNode. When this happens, I hear a click or pop because the volume isn't faded. How can I achieve smooth transitions when making connections? Do I need to implement the fade myself within…
Taylor
  • 5,871
  • 2
  • 30
  • 64
4
votes
3 answers

AVAudioEngine: Starting a set of AVAudioPlayerNodes at once

I'm working on an app that starts a number of loops simultaneously, and should maintain their sync. Using previous, naive approaches to the problem (not using AVAudioEngine), I found that programmatically starting a number of audio players in…
Darren Black
  • 1,030
  • 1
  • 9
  • 28
4
votes
2 answers

Check if node already attached to AVAudioEngine

I successfully attach AVAudioPlayer nodes to my AVAudioEngine. However, I need to later check if these nodes have already been attached to it (so I don't re-add them). Is there any certain property on the engine that I can check to see if its…
vikzilla
  • 3,998
  • 6
  • 36
  • 57
4
votes
3 answers

AVAudioEngine & AVAudioPlayerNode didFinish method like AVAudioPlayer

Is there any possibility to identify if the AVAudioEngine did finish its played sound? In the past I used the AVAudioPlayer's function: func audioPlayerDidFinishPlaying(player: AVAudioPlayer, successfully flag: Bool) { // Code after finished…
AlexWoe89
  • 844
  • 1
  • 11
  • 23
4
votes
0 answers

Using AVAudioEngine to record to compressed file

I'm trying to use AVAudioEngine to record sounds from the microphone together with various sound effect files to a AVAudioFile. I create an AVAudioFile like this: let settings = self.engine.mainMixerNode.outputFormatForBus(0).settings try…
rodskagg
  • 3,827
  • 4
  • 27
  • 46
4
votes
1 answer

AVAudioEngine: any way to control buffer size (latency)?

I've written a V3 AudioUnit and have hosted it using AVAudioUnit. My render callback is called with 512 frames, which is too high latency for my app (a synthesizer). Is there a way with AVAudioEngine to set the processing buffer size? Or do I need…
Taylor
  • 5,871
  • 2
  • 30
  • 64
4
votes
1 answer

Playing musicSequence on AVAudioEngine

AVAudioEngine has a musicSequence property that can be set. However, I am having a hard time figuring out how to play it? I tried using startAndReturnError but to no avail
Thomas
  • 61
  • 4
4
votes
3 answers

Add input callback to AVAudioEngine

I'm attempting to add an input callback to an AVAudioEngine's inputNode but it's never being called. The hope is that I can use AVAudioEngine to manage the basic AUGraph for both iOS and OS X and I can run my own code in between. I've also tried…
GScrivs
  • 865
  • 1
  • 7
  • 19
4
votes
1 answer

AVAudioEngine incorrect time management and callback for AVAudioPlayerNode

I have a serious issue with the new audio engine in iOS8. I have an application, which is built with AVAudioPlayer and I am trying to figure out a way to migrate to the new architecture, however I bumped into the following problem (which I'm sure…
3
votes
0 answers

iOS: Button Press on Bluetooth Headset not detected on playAndRecord category

I have an iOS application that uses an AVAudioSession of category playAndRecord and mode default to record and play audio from and to a Bluetooth headset. Now I want to for start and stop the recording using the buttons on the headset via…
erksch
  • 501
  • 4
  • 14