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

Stream audio on iOS. Respone result with 206 - partial content

I am trying to build an audio stream app. I am getting a response like the following: Request Method: GET Status Code: 206 Partial Content Response Header: Accept-Ranges: bytes Content-Length: 2728759 Content-Range: bytes…
razvan
  • 355
  • 4
  • 19
2
votes
1 answer

Converting AvAudioInputNode to S16LE PCM

I'm trying to convert input node format to S16LE format. I've tried it with AVAudioMixerNode First I create audio session do { try audioSession.setCategory(.record) try audioSession.setActive(true) } catch { ... } //Define formats let…
2
votes
1 answer

audioEngine.start() throws exception when called

Problem I'm trying to record microphone data using AVAudioEngine. This is my setup. First I create singleton session, set sessions category and activate it. let audioSession = AVAudioSession.sharedInstance() do { try…
2
votes
1 answer

How to correctly convert AVAudioCompressedBuffer into Data and back

I have an AVAudioCompressedBuffer instance that gets correctly decoded and played by my AVAudioEngine. The problem is that after converting it to Data and then back to AVAudioCompressedBuffer it is no longer playable and throws a…
Lucas Pereira
  • 569
  • 1
  • 11
  • 23
2
votes
1 answer

Route live audio from line-in to AirPods?

Is there a way to route the audio coming from the wired line-in input directly to AirPods? Currently, I'm creating a .playAndRecord audio session. Paired the AirPods. Later on, with AVAudioEngine I connect the input device directly to the output…
Geri Borbás
  • 15,810
  • 18
  • 109
  • 172
2
votes
0 answers

routeChangeNotification and OS Media Reset/Lost not working after .setPreferredInput(...) is called and microphone is unplugged

This question is a broader description of the bug documented here. I'm reproducing the steps below on iPhone 8 and iOS 14.7. How can I achieve my AVAudioSession and AVAudioEngine instances to work properly, even when I disconnect a microphone after…
2
votes
0 answers

Error in processing Audio file with proper format and data

I am trying to merge processing audio url with video url. I have proceed audio in order to change pitch value using audioEngine.renderOfflinemethod. But output audio file return nil value for audioAsset.tracks(withMediaType: .audio).first (Also…
2
votes
0 answers

Cannot record using AVAudioEngine

I'm trying to record some audio using AVAudioEngine, but when I start recording with the methods that I have in my setup class, the app crashes and gives me some error, like the following: 2021-07-15 21:28:27.569564-0400 App[75861:6634462] [avae] …
Edward Pizzurro
  • 575
  • 4
  • 15
2
votes
0 answers

Synchronising AVAudioEngine audio recording with backing track, using AirPods

I'm trying to identify how much latency is being experienced when using AirPods, compared to using the device mic & speaker, for the purposes of recording user video & audio that must be synchronised to a backing track. Here's how my system…
Cloov
  • 538
  • 1
  • 3
  • 15
2
votes
1 answer

how to get buffer from AVAudioEngine's installTap at high frequency

I am looking to render audio waveform on screen like iOS voice memo app, so I am using AVAudioEngine and installed Tap on input node. But it gives fastest call back on 0.1sec frequency , I need to get buffer data on faster frequency , so that can…
Amit Singh
  • 63
  • 8
2
votes
2 answers

Timing issues: Metronome using AVAudioEngine scheduleBuffer's completion handler

I want to build a simple metronome app using AVAudioEngine with these features: Solid timing (I know, I know, I should be using Audio Units, but I'm still struggling with Core Audio stuff / Obj-C wrappers etc.) Two different sounds on the "1" and…
McNail
  • 100
  • 8
2
votes
0 answers

AudioEngine to CMSampleBuffer

I am using AVAudioEngine to capture audio from macOS microphone and some other sources to mix multiple audio inputs, since the AVAudioCaptureSession does not have a feature to mix multiple inputs. Therefore, I am trying to convert the…
k2sebeom
  • 21
  • 1
2
votes
0 answers

How to route the microphone sound to the speaker by using AVAudioEngine on MacOS?

I am studying the audio unit development. First I want to build a macOS app that simply fetch the audio from microphone then send it out to speaker that we can hear it. engine = AVAudioEngine() let hardwareFormat =…
Hao Wu
  • 111
  • 6
2
votes
0 answers

How can I resample an audio file programatically in swift?

I would like to know if it's possible to resample an already written AVAudioFile. All the references that I found don't work on this particular problem, since: They propose the resampling while the user is recording an AVAudioFile, while installTap…
2
votes
0 answers

AVAudioEngine Input Node only seeing first device inputs from connected Aggregate Audio Device Swift macOS

I am trying to process the individual channels of a multichannel Soundcard, using AVAudioEngine. In order to do that, I first discover the DeviceID of the Soundcard I want to connect to my AVAudioEngine. Then I assign the device to the auAudioUnit…