Skip to content

Create soundInstance with audiobuffer or htmlAudioElement #294

Description

@KenilDomadia

Hello,

I am trying to play audio from downloaded zip of audio files in browser. I download the zip while starting the app and store ArrayBuffer in memory. I want to play the sound using these stored ArrayBuffer. I am facing the similar issue mentioned above as I am not able to find this feature in the version I'm using. Do we have support for playing the audio/creating soundInstance using ArrayBuffer? I'd really appreciate, if we have this feature as I do not want to shift to another library for doing the same. I am using createjs version 1.0.0. Thanks.

Activity

  1. danzen commented on Mar 19, 2018

    @danzen
    Contributor

    Hi folks,

    Here is probably how we could play it without SoundJS but it would be good to have a way to play it with SoundJS (if there is not one already)
    https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/decodeAudioData

    Howler accepts data - here is a message from their forum:

    Howler will accept a data: URI structure, If the audioStream can be converted to a arrayBuffer, there is code available to Base64 encode it, then you could do something like:

    howlSource = ["data:audio/mp3;base64,"+base64ArrayBuffer(arrayBuffer)];
    soundPlayerObj = new Howl({
    src: howlSource,
    });

    It would be cool if it were the whole system so we could use PreloadJS to load and unzip and then make them available to play as their file names for IDs or some such thing. Otherwise, I guess it would just be a method to play an arrayBuffer that we would have to get ourselves from zip files.

  2. lannymcnie commented on Mar 19, 2018

    @lannymcnie
    Member

    AudioBuffer support is already planned for SoundJS 2.0 (ES6), but might be worthwhile to add to version 1.0 as well if its a fairly straightforward feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions