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
7
votes
0 answers

Audio recording using AVAudioEngine with setting output audio port

In order to make avaliable playback and recording at the same time we use these methods for setting AVAudioSession category: AVAudioSession *audioSession = [AVAudioSession sharedInstance]; [audioSession…
7
votes
1 answer

Trying to stream audio from microphone to another phone via multipeer connectivity

I am trying to stream audio from the microphone to another iPhone via Apples Multipeer Connectivity framework. To do the audio capturing and playback I am using AVAudioEngine (much thanks to Rhythmic Fistman's answer here). I receive data from the…
nullforlife
  • 1,244
  • 1
  • 14
  • 29
7
votes
0 answers

AVAudioEngine to record mic and sound files and avoid feedback loop

I'm trying to use AVAudioEngine to record sound from the microphone and sound files (which are played when the user taps a button). I have hooked up the mic inputNode to the mainMixer, as well as a couple of AVAudioPlayerNodes for playing sound…
andlin
  • 3,534
  • 3
  • 25
  • 43
7
votes
7 answers

completionHandler of AVAudioPlayerNode.scheduleFile() is called too early

I am trying to use the new AVAudioEngine in iOS 8. It looks like the completionHandler of player.scheduleFile() is called before the sound file has finished playing. I am using a sound file with a length of 5s -- and the println()-Message appears…
Oliver
  • 1,348
  • 1
  • 11
  • 11
7
votes
2 answers

How do I connect AVAudioEngine to a Lightning Port audio input?

I'd like to connect my electric guitar to my app. I have hardware (the Line6 Sonic Port) that passes the audio from my guitar into my iPhone. I've figured out how to get audio playing out to my headphones, but it's audio coming from my headphone…
bryanjclark
  • 5,978
  • 2
  • 31
  • 63
6
votes
2 answers

AVAudioEngine reconcile/sync input/output timestamps on macOS/iOS

I'm attempting to sync recorded audio (from an AVAudioEngine inputNode) to an audio file that was playing during the recording process. The result should be like multitrack recording where each subsequent new track is synced with the previous…
jnpdx
  • 17,680
  • 3
  • 28
  • 44
6
votes
0 answers

required condition is false: format.sampleRate == hwFormat.sampleRate in my iPhone 11 Pro

I am using AVAudioSession and AVAudioInputNode to record voice in iOS. To initialise it I was using the following settings, which was working fine: [AVFormatIDKey: kAudioFormatLinearPCM, AVLinearPCMBitDepthKey: 16, AVLinearPCMIsFloatKey: true,…
6
votes
0 answers

Status bar shows mic icon for a moment when pausing/stopping AVAudioEngine in iOS 13

Each time I stop/pause the audio engine (using AVAudioEngines stop() or pause()), a red mic icon appears on the status bar for a second. This starts to be annoying after a while, something red appearing at the top each time I pause/stop the…
ernewston
  • 633
  • 4
  • 14
6
votes
2 answers

AVAudioConverter with AVAudioConverterInputBlock stutters audio after processing

I'm trying to convert audio buffers to a different format, and I'm using AVAudioConverter. AVAudioConverter does the job when you have the same sample rate and you don't need to use the AVAudioConverterInputBlock. But if I'm dealing with the same…
MScottWaller
  • 2,611
  • 16
  • 36
6
votes
1 answer

AVAudioConverter float32/48khz -> int16/16khz conversion failure

This method handles the callback from installTap on the input node from an AVAudioEngine. I have confirmed that I'm getting mono float32/48000hz buffer data, and I'd like to convert it to mono int16/16000hz. var converter: AVAudioConverter? =…
Jacob Jennings
  • 2,668
  • 1
  • 21
  • 26
6
votes
1 answer

Test flight app crashes with libAVFAudio.dylib: AVAE_RaiseException(NSString*, ...) + 60

I uploaded an archive on app store and am getting crash when I 'm trying to play an intro sound. I'm using AVAudioEngine to play the sound. When I compile and run code through Xcode everything works fine. When I upload on TestFlight and try to run…
Thomas
  • 177
  • 2
  • 9
6
votes
3 answers

Fade out volume of AVAudioPlayerNode programmatically

I've got an AVAudioEngine setup with a AVAudioPlayerNode that is playing some background music. I'm trying to find a best approach to create a volume fadeout on the node over a 2 second timeframe. I'm considering using CADisplayLink in order to do…
Danny Bravo
  • 4,205
  • 1
  • 21
  • 40
6
votes
2 answers

SWIFT - Is it possible to save audio from AVAudioEngine, or from AudioPlayerNode? If yes, how?

I've been looking around Swift documentation to save an audio output from AVAudioEngine but I couldn't find any useful tip. Any suggestion? Solution I found a way around thanks to matt's answer. Here a sample code of how to save an audio after…
mlk
  • 389
  • 2
  • 10
6
votes
2 answers

AVAudioEngine seek the time of the song

I am playing a song using AVAudioPlayerNode and I am trying to control its time using a UISlider but I can't figure it out how to seek the time using AVAUdioEngine.
luciansvnc
  • 101
  • 1
  • 7
5
votes
1 answer

Synchronize AVAudioPlayerNode and start of recording AVAudioEngine

I am using AVAudioEngine to both play and record audio. For my use case, I need to play a sound exactly when I start recording audio. Currently, my recording seems to start before the sound is played. How would I make the sound and the recording…
coder
  • 283
  • 1
  • 16
1 2
3
29 30