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

Render audio file offline using AVAudioEngine

I want to record audio file and save it by applying some effects. Record is okay and also playing this audio with effect is okay too. The problem is when I try to save such audio offline it produces empty audio file. Here is my code: let effect =…
Mikita Kaltsou
  • 273
  • 3
  • 10
5
votes
1 answer

Capture audio samples with a specific sample rate like Android in iOS Swift

I am a beginner in working with sound processing and AVAudioEngine in iOS, and I'm developing an application that captures the audio samples as a buffer and analyzes it. Furthermore, the sample rate must be 8000 kHz and also must be encoded as…
Mohamed Salah
  • 868
  • 1
  • 15
  • 34
5
votes
1 answer

Is there a way to show lock screen controls using AVAudioEngine and AVAudioPlayerNode?

I am handling audio playback using AVAudioEngine and AVAudioPlayerNode in my app, and I want to implement remote controls. Background audio is configured and working. Control center controls work, but the play/pause button does not update when I…
5
votes
2 answers

How to play sound to a specific output channel on a USB audio interface?

I've got a motu UltraLite mk4 USB audio interface attached to a Mac running MacOS 10.13.3. I'm trying to play three stereo sound files, each to its own stereo speaker. To start with less complexity, I'm just trying to get the stereo sound of one…
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
  • 91
  • 1
  • 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
  • 2,185
  • 1
  • 13
  • 22
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
  • 71
  • 2
5
votes
0 answers

AVAudioEngine, AVPlayer, AVPlayerViewController - Control Center controls becomes disabled when AVPlayerViewController plays video

I am using AVAudioEngine to play audio files and AVPlayer and AVPlayerViewController to play videos. and Control Center notification are enabled UIApplication.shared.beginReceivingRemoteControlEvents() Control Center works perfectly for audio files…
PGill
  • 3,373
  • 18
  • 21
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
1 answer

AVAudioEngine uses wrong format when bluetooth headset plugged in

I have a pair of bluetooth headphones with microphone input. The microphone is not used, but when it is, both input and output is forced to 8000kHz. My AVAudioEngine instance connects to the headset in 8000kHz mode, unless I enter the system…
Henrik
  • 3,908
  • 27
  • 48
5
votes
1 answer

iOS Speech-to-text AVAudioInputNode(?) random crash

I have a speech-to-text function in my app, press & hold the button; a viewcontroller is animated from outside windowbounds into view and recording starts, release the button; recording stops and view is animated out of windowbounds. Suddenly I'm…
5
votes
2 answers

InstallTapOnBus - for output signal

As in topic subject, I want to analyze buffer of the output signal. I've used this function ( InstallTapOnBus ) for microphone signal, but i does not work for output. Anyone know how do that? let bus = 0 let node = engine.outputNode …
Szymon Mrozek
  • 117
  • 1
  • 6
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,739
  • 4
  • 29
  • 57
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,822
  • 12
  • 21
5
votes
0 answers

Writing mono AVAudioPCMBuffer to stereo AVAudioFile

I'm using AVAudioEngine to record audio, and saving it as a sound file. The user can choose to import an audio file, and they can then continue to record at the end of this file if they wish to. I'm getting the audio data from the imported file by…
rodskagg
  • 3,827
  • 4
  • 27
  • 46