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
23
votes
2 answers

Using sound effects with AudioEngine

Background - I saw a video titled "AVAudioEngine in Practice" from the following list of videos published at Apple's recent WWDC to apply sound effects to an audio. https://developer.apple.com/videos/wwdc/2014/ After that, I was successfully able to…
user1205193
  • 231
  • 1
  • 2
  • 4
21
votes
1 answer

AVAudioPlayerNode lastRenderTime

I use multiple AVAudioPlayerNode in AVAudioEngine to mix audio files for playback. Once all the setup is done (engine prepared, started, audio file segments scheduled), I'm calling play() method on each player node to start playback. Because it…
Vince
  • 445
  • 3
  • 17
20
votes
6 answers

Level Metering with AVAudioEngine

I just watched the WWDC Video (Session 502 AVAudioEngine in Practice) on AVAudioEngine and am very excited to make an app built on this tech. I haven't been able to figure out how I might do level monitoring of the microphone input, or a mixer's…
horseshoe7
  • 2,629
  • 2
  • 29
  • 43
18
votes
6 answers

AVAudioEngine inputNode installTap crash when restarting recording

I am implementing Speech Recognition in my app. When I first present the view controller with the speech recognition logic, everything works fine. However, when I try present the view controller again, I get the following crash: ERROR: …
18
votes
4 answers

Realtime Audio with AVAudioEngine

Hej. I want to implement a realtime audio application with the new AVAudioEngine in Swift. Has someone experience with the new framework? How does real time applications work? My first idea was to store the (processed) input data into a…
Michael Dorner
  • 11,986
  • 10
  • 64
  • 95
17
votes
5 answers

How can I specify the format of AVAudioEngine Mic-Input?

I'd like to record the some audio using AVAudioEngine and the users Microphone. I already have a working sample, but just can't figure out how to specify the format of the output that I want... My requirement would be that I need the…
Georg
  • 3,119
  • 2
  • 27
  • 60
16
votes
1 answer

(Swift) Initializer for conditional binding must have Optional type, not 'AVAudioInputNode'

I am trying to create a speech to text function and I am getting the error: Initializer for conditional binding must have Optional type, not 'AVAudioInputNode' guard let inputNode = audioEngine.inputNode else { fatalError("Audio engine has…
Niall Kiddle
  • 1,319
  • 1
  • 12
  • 30
15
votes
1 answer

Can I use AVAudioEngine to read from a file, process with an audio unit and write to a file, faster than real-time?

I am working on an iOS app that uses AVAudioEngine for various things, including recording audio to a file, applying effects to that audio using audio units, and playing back the audio with the effect applied. I use a tap to also write the output to…
Greg
  • 32,510
  • 15
  • 88
  • 99
14
votes
0 answers

How to suppress warnings generated by accessing `AVAudioEngine`'s `inputNode` on macOS

I have the following test code for getting realtime microphone input on macOS: import AVFoundation // for AVAudioEngine class Mic { public let audioEngine = AVAudioEngine() func startRecording() throws { print("- - -") …
P i
  • 25,182
  • 33
  • 133
  • 229
14
votes
2 answers

Crash in AVAudioEngine.start() even though it's wrapped in do/catch

I have the following code to (re)start AVAudioEngine wired up to AVAudioEngineConfigurationChangeNotification: do { try self.engine.start() } catch { DDLogError("could not start sound engine") self.soundEnabled = false …
Mike
  • 193
  • 1
  • 10
13
votes
1 answer

Export audio file after adding an effect

I have an audio file that I want to process using some effects (like pitch effect) and then write the final result to a file. Before I process the file and save it to disc I let the user play with the pitch effect and listen to the changes in real…
Eyal
  • 10,429
  • 18
  • 73
  • 127
12
votes
0 answers

Vexing crash in AVAudioEngine

I have written the following AVAudioEngine code that initializes one of my custom AUAudioUnit subclasses and wires it up to the main mixer node of the engine. class AudioEngine { let engine = AVAudioEngine() init() { let sess =…
Alex Bollbach
  • 3,730
  • 2
  • 25
  • 61
12
votes
2 answers

SKAudioNode() crashes when plugging in/out headphones

I am using a SKAudioNode() to play background music in my game. I have a play/pause function and everything is working fine until I plug in my headphones. There is no sound at all and when I call the pause/play function I get this…
Cherrypig
  • 370
  • 1
  • 2
  • 12
12
votes
2 answers

Spectrogram from AVAudioPCMBuffer using Accelerate framework in Swift

I'm trying to generate a spectrogram from an AVAudioPCMBuffer in Swift. I install a tap on an AVAudioMixerNode and receive a callback with the audio buffer. I'd like to convert the signal in the buffer to a [Float:Float] dictionary where the key…
Jakub
  • 473
  • 5
  • 12
12
votes
3 answers

Using AVAudioEngine to schedule sounds for low-latency metronome

I am creating a metronome as part of a larger app and I have a few very short wav files to use as the individual sounds. I would like to use AVAudioEngine because NSTimer has significant latency problems and Core Audio seems rather daunting to…
blwinters
  • 1,634
  • 16
  • 34
1
2 3
29 30