Questions tagged [avaudioplayernode]
110 questions
4
votes
2 answers
AVAudioEngine: Playing a stream of Int16 PCM samples
I'm receiving a stream of 16 bit / 48 kHz stereo PCM samples as Int16s and I'm trying to play them using AVAudioEngine, however I am not hearing anything at all. I'm thinking it either has something to do with the way I set up the player or maybe…

Tobias Timpe
- 720
- 2
- 13
- 27
4
votes
1 answer
Real time pitch shifting in swift iOS
I want to implement an iOS app (in swift) that changes the pitch of phones mic input and play the modified voice through speakers as the user speaks with minimum delay (a few mili seconds at most).
So far I have the following code:
import…

Alireza Moradi
- 308
- 3
- 10
4
votes
0 answers
How to use AvAudiounit features like low pass and time delay with AvAudioPlayer node
I'm using Apple's AudioEngine and I'm able to play sound by using AvAudioPlayerNode.The problem is when i try to add any feature such as low pass filter or even time delay, it is not affecting my player. How do I make these effects affect with…

Abraham
- 41
- 5
4
votes
1 answer
Play segment of AVAudioPCMBuffer
I'm creating this simple audio recorder and editor interface for an iOS app:
The audio is recorded into a float array that is used to create the waveform. After recording I copy the float data into an AVAudioPCMBuffer for playing with…

torof
- 368
- 1
- 12
4
votes
1 answer
AVAudioPlayerNode scheduled buffers and audio route change in iOS11
I am seeing different behaviour between iOS 9/10 and iOS 11 for buffers that are future scheduled on an AVAudioPlayerNode when an audio route change occurs (e.g. you plug in headphones). Has anyone experienced anything similar and how did you…

Andrew Coad
- 297
- 2
- 13
4
votes
1 answer
Read an AVAudioFile into a buffer starting at a certain time
Let's say I have an AVAudioFile with a duration of 10 seconds. I want to load that file into an AVAudioPCMBuffer but I only want to load the audio frames that come after a certain number of seconds/milliseconds or after a certain…

WongWray
- 2,414
- 1
- 20
- 25
4
votes
1 answer
How can I play a sound from the asset catalog using AVAudioPlayerNode?
I'm trying to use an AVAudioPlayerNode to play sounds from the Assets.xcassets asset catalog, but I can't figure out how to do it.
I've been using AVAudioPlayer, which can be initialized with an NSDataAsset like this:
let sound = NSDataAsset(name:…

Robert
- 6,660
- 5
- 39
- 62
4
votes
0 answers
detect the end of a file in AVAudioPlayerNode
I have set up an audio multitrack player using apple's AVFoundation. I use nine AVAudioPlayerNodes attached to an AVAudioEngine and they are played at precisely the same time. In spriteKit, in my game scene, I would like to detect the end of the…

derekFairholm
- 285
- 1
- 14
4
votes
2 answers
Check if node already attached to AVAudioEngine
I successfully attach AVAudioPlayer nodes to my AVAudioEngine. However, I need to later check if these nodes have already been attached to it (so I don't re-add them).
Is there any certain property on the engine that I can check to see if its…

vikzilla
- 3,998
- 6
- 36
- 57
4
votes
1 answer
AVAudioEngine incorrect time management and callback for AVAudioPlayerNode
I have a serious issue with the new audio engine in iOS8. I have an application, which is built with AVAudioPlayer and I am trying to figure out a way to migrate to the new architecture, however I bumped into the following problem (which I'm sure…

Lehel Medves
- 527
- 1
- 5
- 15
3
votes
0 answers
Swift: How to convert AVAudioEngine's stereo output to mono
I´m trying to convert the output of my AVAudioEngine from stereo to mono. I want to be able to send the converted mono signal to the left or right headphone or speaker using AVAudioPlayerNode's pan property.
engine.connect(audioFilePlayer[i], to:…

lololarumpel
- 57
- 4
3
votes
0 answers
How to Play PCM 16 bit using AVAudioPlayerNode?
i have app decoding stream audio over network from opus to pcm, the out data is PCM 16 bit, i decode it successfully, but when i try to play it using AVAudioEngine it fail, i can not change the sample rate from 44100 to 48000 which opus…

Ahmed
- 112
- 2
- 12
3
votes
2 answers
Calling stop() on AVAudioPlayerNode after finished playing causes crash
I have an AVAudioPlayerNode object which sends a callback once it is finished playing. That callback triggers many other functions in the app, one of which sends out a courtesy stop() message. For some reason, calling stop() at the moment the…

dmann200
- 529
- 4
- 11
3
votes
1 answer
How to change AVAudioPlayerNode format when user switches headphones
I need to play an arbitrary tone that is generated based on the sample rate of the output device. User is required to connect wired or wireless headphones in order to listen to the audio.
Since modern headphones can have native sample rate of 44100…

Roman Samoilenko
- 932
- 12
- 25
3
votes
1 answer
iOS - AVAudioPlayerNode.play() execution is very slow
I'm using AVAudioEngine for audio in an iOS game application. A problem I've encountered is that AVAudioPlayerNode.play() takes a long time to execute, which can be a problem in real-time applications such as games.
play() just activates the player…

scg
- 449
- 1
- 3
- 11