Coder Social home page Coder Social logo

Comments (3)

emurray2 avatar emurray2 commented on July 20, 2024

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).

from cookbook.

NewajShovo avatar NewajShovo commented on July 20, 2024

@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.

from cookbook.

emurray2 avatar emurray2 commented on July 20, 2024

Sure thing, here are the steps:

  1. Create an instance of the audio player class
    var myPlayer = AudioPlayer()

  2. Convert your decoded NSData from Data to AVAudioPCMBuffer using the code in the Stackoverflow link above

  3. Set the buffer of your audio player to the chunk of data you want to play
    myPlayer.buffer = myData

  4. 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.

from cookbook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.