avaudioengine

AVAudioCompressedBuffer to UInt8 array and vice versa

≯℡__Kan透↙ 提交于 2021-02-19 20:57:05
问题 I would like to know how to get the bytes of an AVAudioCompressedBuffer and then reconstruct an AVAudioCompressedBuffer from the bytes. The code below takes an AVAudioPCMBuffer, compresses it with AVAudioConverter to AVAudioCompressedBuffer (iLBC) and gets the bytes, then converts the bytes back to AVAudioCompressedBuffer (iLBC) and uncompresses back to AVAudioPCMBuffer and plays the buffer. Something goes wrong with converting the AVAudioCompressedBuffer to bytes and back. If I skip this

AVAudioCompressedBuffer to UInt8 array and vice versa

Deadly 提交于 2021-02-19 20:56:15
问题 I would like to know how to get the bytes of an AVAudioCompressedBuffer and then reconstruct an AVAudioCompressedBuffer from the bytes. The code below takes an AVAudioPCMBuffer, compresses it with AVAudioConverter to AVAudioCompressedBuffer (iLBC) and gets the bytes, then converts the bytes back to AVAudioCompressedBuffer (iLBC) and uncompresses back to AVAudioPCMBuffer and plays the buffer. Something goes wrong with converting the AVAudioCompressedBuffer to bytes and back. If I skip this

How to encode and decode Real-time Audio using OpusCodec in IOS?

烂漫一生 提交于 2021-02-07 07:53:41
问题 I am working on a app which has following requirements : Record real time audio from iOS device (iPhone) Encode this audio data to Opus data and send it to server over WebSocket Decode received data to pcm again Play received audio from WebSocket server on iOS device(iPhone) I've used AVAudioEngine for this. var engine = AVAudioEngine() var input: AVAudioInputNode = engine.inputNode var format: AVAudioFormat = input.outputFormat(forBus: AVAudioNodeBus(0)) input.installTap(onBus:

MacOSX Console Application to slow or speedup speech without losing quality

徘徊边缘 提交于 2021-01-28 03:50:24
问题 I have a .mp3 file that contains just voice and I would like to adjust the speed (slower or faster) while maintaining the same clarity. No chipmunks! Then write out the modified file to disk. In order to do this, I am trying to use the AVAudioEngine Framework but am a complete N00B to the framework. All the examples, I have found, are geared to modifying music or recording voice then playing it audibly. I just want to convert to a different speed and have it spit out the modified file. This

AVAudioEngine reconcile/sync input/output timestamps on macOS/iOS

本秂侑毒 提交于 2021-01-23 06:37:00
问题 I'm attempting to sync recorded audio (from an AVAudioEngine inputNode ) to an audio file that was playing during the recording process. The result should be like multitrack recording where each subsequent new track is synced with the previous tracks that were playing at the time of recording. Because sampleTime differs between the AVAudioEngine 's output and input nodes, I use hostTime to determine the offset of the original audio and the input buffers. On iOS, I would assume that I'd have

Playing an audio file repeatedly with AVAudioEngine

試著忘記壹切 提交于 2020-07-05 04:15:27
问题 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 again? This is my code: /*==================== CONFIGURATES THE AVAUDIOENGINE ===========*/ audioEngine.reset() //Resets any previous configuration on AudioEngine let audioPlayerNode = AVAudioPlayerNode() //The node that will play the actual sound

Playing an audio file repeatedly with AVAudioEngine

故事扮演 提交于 2020-07-05 04:14:11
问题 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 again? This is my code: /*==================== CONFIGURATES THE AVAUDIOENGINE ===========*/ audioEngine.reset() //Resets any previous configuration on AudioEngine let audioPlayerNode = AVAudioPlayerNode() //The node that will play the actual sound