Skip to content

Create soundInstance with audiobuffer or htmlAudioElement #200

@GTStan

Description

@GTStan

Hi,

Is there a way to create a soundInstance with the loaded audiobuffer or htmlAudioElement?
We have a bunch of audio that get used many times so we preload them in the main page. These preloaded audio will be accessed from an iframe within the main page. This iframe is the window that hosts 20 to 40 HTML pages and most of these pages need the audio preloaded in the main page. If the iframe page accesses the soundInstance created in the main page, it gets an error in IE11 when a soundInstance get played after a few times. Our current work around is creating 100 soundInstances and save them in an array as soon as the audio is loaded by using createjs.Sound.createInstance(audioID). Each time we need to play a particular audio, we grab one from the array and increment the array index by 1. This works but as you can see it is not efficient to pre-create 100 instances for each audio and keep them in memory. What if we need more than 100? We hope there is a way to create a soundInstance from the loaded audiobuffer or htmlAudioElement. Either one of these object can be passed on to the iframe page and create the soundInstance there. Unfortunately we browsed through the createjs documentation many times and couldn't find a function that can do this. Is there a better way to workaround this or there is already a way to create soundInstance with audiobuffer or htmlAudioElement that is not in the documentation.

Thank you very much in advance for any advice or help you can provide!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions