Questions tagged [avaudioplayernode]

110 questions
2
votes
1 answer

Swift: disconnect an AVAudioUnit from playing AVAudioEngine

I am playing an audio file with some effects, at some point. Here is the code: engine = AVAudioEngine() playerB = AVAudioPlayerNode() playerB.volume = 0.5 let path = Bundle.main.path(forResource: "ukulele", ofType: "wav")! let…
mahdi
  • 149
  • 12
2
votes
0 answers

Strem Audio From Data Bytes

i am receiving audio from server in bytes format through my socket connection. and i am trying it to convert to PCMFormat to play it. func playAudio(data: NSData){ let buffer = dataToPCMBuffer(format: format16KHzMono!, data: data) let…
Aman.Samghani
  • 2,151
  • 3
  • 12
  • 27
2
votes
0 answers

AVAudioPlayerNode get current time is not correct

I use this code to get an AVAudioPlayerNode's current time, AVAudioTime * nodeTime = _playerNode.lastRenderTime; AVAudioTime * playerTime = [_playerNode playerTimeForNodeTime:nodeTime]; NSTimeInterval seconds =…
guojing
  • 129
  • 14
2
votes
1 answer

Play a sound for a specific number of times in AVAudioPlayerNode in iOS

There is an option numberofloops in AVAudioPlayer which repeats a sound file for a specified number of times. I have to implement this type of function in AVAudioPlayerNode and I found an option just to loop a sound file in an infinite number of…
Simant
  • 3,142
  • 4
  • 32
  • 61
2
votes
1 answer

Sound is playing only for the first time using AVAudioEngine in iOS

I have a sound file which listens as beep sound and I have to play this sound repeatedly with changing its pitch depending on some condition. I am using AVAudioEngine, AVAudioPlayerNode, and AVAudioUnitTimePitch to achieve this objective. There are…
Simant
  • 3,142
  • 4
  • 32
  • 61
2
votes
1 answer

Playing sounds with multiple play buttons in iOS

I have to play three types of wav file one at a time. When I click on the Play button in Enter region it plays a sound named "EnterRegion.wav" and clicking on Exit Region play button plays "ExitRegion.wav" audio file. But for the play button of the…
Simant
  • 3,142
  • 4
  • 32
  • 61
2
votes
1 answer

Is there a way to replay a sound from the beginning using AVAudioPlayerNode?

I have a bunch audio nodes set up as so var audioPlayers = [AVAudioPlayerNode]() var engine = AVAudioEngine() var player = AVAudioPlayerNode() @IBAction func key(_ sender: UIButton) { audioPlayers[someindex].play() } func…
2
votes
1 answer

Playing Multiple WAV out Multiple Channels AVAudioEngine

I have 15 WAV files that I need to play back in sequence all on individual channels. I'm starting out trying to get two files working with a left / right stereo separation. I’m creating an audio engine, a mixer and two AVAudioPlayerNodes. The audio…
tsugua
  • 197
  • 1
  • 13
2
votes
1 answer

How to use AVAudioPlayerNode with AVMutableComposition

The AVAudioEngine and related AVAudioNode objects seem to be quite powerful for audio processing but it's difficult to see how to automate parameter changes with them. I'm sure there must be something more effective than manually using a Timer to…
2
votes
0 answers

AVAudioPlayerNode - Mix between schedule buffers and segments

I'm writing an application where I should play parts of audio files. Each audio file contains audio data for a separate track. These parts are sections with a begin time and a end time, and I'm trying to play those parts in the order I choose. So…
Vince
  • 525
  • 1
  • 3
  • 19
2
votes
1 answer

What is the best way to change AudioPitch withOut noise

I am very new about voice changer apps.Can any one Please suggest me the way to change the pitch like girl voice. here is the code what i used. audioPlayerNode=[[AVAudioPlayerNode alloc]init]; [audioEngine attachNode:audioPlayerNode]; …
2
votes
1 answer

How to remove/volume down vocal from music using AVAudioSession

I am developing the app which required to Record audio when music is playing. I can successfully record sound with music. But I can't remove vocal from music. It will also be great, if I can volume down of vocal when it rise. I am using…
girish_pro
  • 838
  • 9
  • 18
1
vote
0 answers

Swift AVAudioUnitReverb's bypass property works incorrectly

Looks like bypass property for AVAudioUnitReverb works incorrectly. If AVAudioUnitReverb.bypass is set to true - it's switch off whole graph and no sound produced from the engine's output node. It is incorrect behaviour, since it should switch off…
1
vote
0 answers

How to update MPNowPlayingInfoCenter/MPRemoteCommandCenter play/pause controls with AVAudioPlayerNode?

I am making a simple music player app that just plays audio using AVAudioEngine. When I pause the AVAudioPlayerNode, it does not update the play/pause control of the MPNowPlayingInfoCenter/MPRemoteCommandCenter. How do I update it? I dont want to…
SwiftEnthusiast
  • 402
  • 2
  • 10
1
vote
0 answers

Avoid delay playing audio over music from other apps (Soundcloud)

So as I'm writing this, I'm realizing just how specific this issue is... I'm making an iOS app which plays sounds over other apps' music, but with some apps (so far only one, actually), I'm experiencing a lag when playing sounds that doesn't occur…