Closed NewajShovo closed 1 year ago
Yes, please see: https://stackoverflow.com/questions/28048568/convert-avaudiopcmbuffer-to-nsdata-and-back. Then you can create an AudioPlayer
instance and set its buffer using myPlayer.buffer = AVAudioPCMBuffer(myData)
.
@emurray2 thanks for the update. Let me dive into the problem a bit more.
Basically, I have an array of NSData where a chunk of data is saved. I passed that data as an AEAudioPlayable instance in the "The Amazing Audio Engine" framework to play that data. Each chunk is of 0.06 seconds.
So, I want to achieve this using Audiokit. is that possible so that I can pass each chunk of data that plays for 0.06 seconds? Though I have to deal with decoding the data as well but I am ignoring that for now.
Any help would be highly appreciated.
Sure thing, here are the steps:
Create an instance of the audio player class
var myPlayer = AudioPlayer()
Convert your decoded NSData
from Data
to AVAudioPCMBuffer
using the code in the Stackoverflow link above
Set the buffer of your audio player to the chunk of data you want to play
myPlayer.buffer = myData
Play the player
myPlayer.play()
PS: In general issues are for if you are experiencing a bug with AudioKit rather than questions on how to implement code. If you want to discuss this more, please join our discord.
Description
I have been using "The Amazing Audio Engine" and "AEAudioPlayable" for playing an audio stored in database as NSData. I want to replace the current framework to Audiokit but problem is that, I couldn't find any way to do it using audiokit.
Proposed Solution
Is there any way currently here to implement this??
Describe Alternatives You've Considered
Is there any way currently here to implement this??
Additional Context
No response