Questions tagged [avaudioplayernode]

97 questions
23
votes
2 answers

Using sound effects with AudioEngine

Background - I saw a video titled "AVAudioEngine in Practice" from the following list of videos published at Apple's recent WWDC to apply sound effects to an audio. https://developer.apple.com/videos/wwdc/2014/ After that, I was successfully able to…
user1205193
  • 231
  • 1
  • 2
  • 4
21
votes
1 answer

AVAudioPlayerNode lastRenderTime

I use multiple AVAudioPlayerNode in AVAudioEngine to mix audio files for playback. Once all the setup is done (engine prepared, started, audio file segments scheduled), I'm calling play() method on each player node to start playback. Because it…
Vince
  • 445
  • 3
  • 17
12
votes
3 answers

Using AVAudioEngine to schedule sounds for low-latency metronome

I am creating a metronome as part of a larger app and I have a few very short wav files to use as the individual sounds. I would like to use AVAudioEngine because NSTimer has significant latency problems and Core Audio seems rather daunting to…
blwinters
  • 1,634
  • 16
  • 34
9
votes
1 answer

Build a simple Equalizer

I would like to make a 5-band audio equalizer (60Hz, 230Hz, 910Hz, 4kHz, 14kHz) using AVAudioEngine. I would like to have the user input gain per band through a vertical slider and accordingly adjust the audio that is playing. I tried using…
9
votes
5 answers

how to play sound with AVAudioPCMBuffer

I Cannot play sound with AVAudioPCMBuffer (though I could play with AVAudioFile). I got this error. ERROR: AVAudioBuffer.mm:169: -[AVAudioPCMBuffer initWithPCMFormat:frameCapacity:]: required condition is false: isCommonFormat here is my code below,…
Bick
  • 713
  • 1
  • 8
  • 17
8
votes
5 answers

Saving Audio After Effect in iOS

i am developing an applicatoin so that people can record and change their voices thru app and share it . Basically i so many things and now its time to ask you to help . Here is my play function which plays recorded audio file and adds effects on it…
Kaan Baris Bayrak
  • 2,613
  • 3
  • 13
  • 20
7
votes
1 answer

AVAudioEngine inputNode's format changes when playing an AVAudioPlayerNode

I'll start with a simple "playground" view controller class I've made that demonstrates my problem: class AudioEnginePlaygroundViewController: UIViewController { private var audioEngine: AVAudioEngine! private var micTapped = false …
WongWray
  • 1,685
  • 1
  • 18
  • 20
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
6 answers

How to display song currenttime and duration by using AVAudioPlayerNode

I'm making an audio player using AVAudioPlayerNode and playing a song with some effect (delay, pitch change, rate change etc) works, but I'm stuck on displaying song current time and duration. AVAudioPlayerNode seems not have like…
Bick
  • 713
  • 1
  • 8
  • 17
5
votes
2 answers

AVAudioEngine synchronization for MIDI playback and recording

Question 1 My first question concerns playback synchronization when using an AVAudioPlayerNode and an AVAudioSequencer for MIDI. Basically I'm trying to play something over MIDI, but they need to be perfectly synchronized. I'm aware there are sync…
funct7
  • 2,849
  • 2
  • 22
  • 29
5
votes
2 answers

Playing an audio file repeatedly with AVAudioEngine

I'm working on an iOS app with Swift and Xcode 6. What I would like to do is play an audio file using an AVAudioEngine, and until this point everything OK. But how can I play it without stopping, I mean, that when it ends playing it starts…
Guillermo Barreiro
  • 1,336
  • 1
  • 11
  • 13
4
votes
1 answer

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…
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
  • 257
  • 2
  • 11
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,182
  • 5
  • 33
  • 58
4
votes
1 answer

AVAudioPlayerNode doesn't play sound

I'm trying to generate sound with code below. Everthing is fine there is no error. But when I executed this code, there is no sound. How can I fix this problem ? By the way, I'm using this example :…
BadCode
  • 113
  • 12
1
2 3 4 5 6 7