Questions tagged [avaudiopcmbuffer]
54 questions
1
vote
1 answer
Failure to initialize a AVAudioCompressedBuffer
I'm trying to initialize an AVAudioCompressedBuffer using this format:
like such:
AVAudioCompressedBuffer*…

gerbil
- 859
- 7
- 26
1
vote
1 answer
AVAudioPCMBuffer Memory Management
I’m using AVAudioEngine to get a stream of AVAudioPCMBuffers from the device’s microphone using the usual installTap(onBus:) setup.
To distribute the audio stream to other parts of the program, I’m sending the buffers to a Combine publisher similar…

Dan Halliday
- 725
- 6
- 22
1
vote
0 answers
Using AudioKit's AVAudioPCMBuffer normalize function to normalize multiple audio files
I've got an array of audio files that I want to normalize so they all have similar perceived loudness. For testing purposes, I decided to adapt the AVAudioPCMBuffer.normalize method from AudioKit to suit my purposes. See here for implementation:…

JoshAdams
- 11
- 1
1
vote
0 answers
Convert PCM Buffer to AAC ELD Format and vice versa
I'm having trouble converting a linear PCM buffer to a compressed AAC ELD (Enhanced Low Delay) buffer.
I got some working code for the conversion into ilbc format from this question:
AVAudioCompressedBuffer to UInt8 array and vice versa
This…

bobski
- 152
- 3
- 14
1
vote
0 answers
play audio stream PCMBuffer, AVAudioPCMBuffer
My task is to receive an audio stream and play it. On the server side, the audio is encoded by pcmInt16 (16bit, 44100 sample rate, 2 channels)
I accept a stream of bytes and encode in AVAudioPCMBuffer and then pass it to the player in the…

marker
- 11
- 1
1
vote
0 answers
Generate Phase Inverse audio file from existing actual audio file to cancel its voice swift
I am recording sound through audio engine and make a file name my_file.caf and trying to make another file which will make its phase inverse that i can cancel its voice in mono.
But when i do some operations and calculations it reversed its sin wave…

Muhammad
- 137
- 1
- 6
1
vote
1 answer
AVAudioPlayerNode using AVAudioPCMBuffer - no audio playing
I am trying to play audio from a PCMBuffer. When I run the below code, for some reason, no audio plays. I do not get any errors.
let engine = AVAudioEngine()
let player = AVAudioPlayerNode()
let inputFormat = AVAudioFormat(
commonFormat:…

zoecarver
- 5,523
- 2
- 26
- 56
1
vote
2 answers
How do I write AVAudioCompressedBuffer to an AAC file in iOS?
I've successfully converted the AVAudioPCMBuffers from AVAudioEngine into AVAudioCompressedBuffers with an AAC format. Now I'm trying to write those buffers to a file but don't know how to do it. AVAudioFile only accepts AVAudioPCMBuffers.
Any help…

dyah
- 63
- 8
1
vote
1 answer
AVAudioPCMBuffer - read(into buffer: AVAudioPCMBuffer) memory crash? (buffer overflow)
The following code works for audio files of short duration on all my devices (iPhone, Apple Watch, Simulator):
let file = try! AVAudioFile(forReading: url!)
let format = AVAudioFormat(commonFormat: .pcmFormatFloat32, sampleRate: …

devone
- 293
- 3
- 10
1
vote
0 answers
How to use AVAudioConverter convertToBuffer:error:withInputFromBlock:
I would like to use AVAudioConverter to convert AVAudioPCMFormatFloat32 non interleaved 44.1 KHz buffer to AVAudioPCMFormatInt16 interleaved 48 KHz.
The incoming AVAudioPCMBuffer have 800 samples and I need to return AVAudioPCMBuffer with 1920…

vtruant
- 273
- 1
- 12
1
vote
1 answer
Find Average Voice Frequency/Range through Microphone (AVAudioPCMBuffer and FFT)
I'm trying to figure out the average frequency or range of a person's voice as they speak into the microphone. It does not have to be real time. My approach so far was to use AVAudioEngine and AVAudioPCMBuffer, get the buffer data and convert it to…

robinyapockets
- 363
- 5
- 21
1
vote
0 answers
Is AVAudioPCMBuffer compressed? If not how to compress it?
I am using AVAudioEngine to record audio. The code looks like that:
inputMixerNode.installTap(onBus: 0, bufferSize: 8192, format: outputFormat) {
(audioPCMBuffer, audioTime) in
try? audioFile.write(from: audioPCMBuffer)
}
My question…

Qiang
- 21
- 2
1
vote
1 answer
UnsafeMutablePointer to UnsafeMutablePointer<_>
I'm really going crazy with a stupid and apparently simple problem...
I have to convert a Data to an AVAudioPCMBuffer.
Looking to this question it seems to be easy, but all has changed with Swift 3. This cursed language which is continuously…

Massimo
- 3,436
- 4
- 40
- 68
1
vote
1 answer
AVAudioPCMBuffer for music files
I've been trying to play music in my SpriteKit game and used the AVAudioPlayerNode class to do so via AVAudioPCMBuffers. Every time I exported my OS X project, it would crash and give me an error regarding audio playback. After banging my head…

02fentym
- 1,762
- 2
- 16
- 29
0
votes
0 answers
How to convert CChar audio buffer into AVAudioPCMBuffer?
I'm working on ZoomMeetingSDK integration for my Mac app. SDK streams audio buffers once a user joins the meeting. I'm trying to convert these audio buffers into AVAudioPCMBuffer so that i can generate a live transcripts by leveraging…