CocoonJS AudioPlugin for SoundJS

PLEASE USE THE UPDATED VERSION OF THIS PLUGIN IF YOU ARE WOKING WITH SoundJS 0.5.2 // CocoonJS 1.4.7 at http://indiegamr.com/soundjs-0-5-2-audio-plugin-for-cocoonjs-1-4-7/

Again a small, but hopefully helpful file: CocoonJSAudioPlugin.js
As the native SoundJS-Plugins: WebAudioPlugin.js and HTMLAudioPlugin, don’t seem to go hand in hand with CocoonJS (yet?) I took the time and wrote a CocoonJSAudio-Plugin based on the HTMLAudioPlugin, may this be of help to someone.

Download: CocoonJSAudioPlugin.js

How to use: Just put the CocoonPlugin as the first entry to register and you can use everything else of the SoundJS-library just as is in CocoonJS now.

  • Jake

    Thanks for your excellent postings!
    Did you happen try displaying Youtube videos with CocoonJS?
    I get a blank image when loading them in the WebView with the IFrame API, see my issue description here:
    http://www.ludei.com/forum#/discussion/7/cocoonjs-general/p6

    I’ll deeply appreciate if you could share your thoughts / experience.

    • olsn

      Sorry I did not do anything with the CocoonJS webview extension yet ;)

  • Richard

    thanks for the plugin however i can’t get it working in iOS 6 either with user initiated events or others. when i log..

    console.log(createjs.Sound.activePlugin);

    i get “CocoonJSAudioPlugin” but no sounds play :(
    everything plays fine in iOS Safari or on the desktop

    • olsn

      Are you getting any errors?
      You have the correct sound-file-format and codec to play on iOS?
      Did you try it with the WebAudioPlugin yet, maybe that works meanwhile in CocoonJS? (haven’t tried it in a while)

  • watacoso

    Hey there olsn , thanks for the plugin!

    sadly i have the same problem of richard. The active plugin is yours (and on desktop it works fine), but on android, wether i use registerSound or preload the with the LoadQueue element, the sounds are ignored . That is, when i look inside the loading process of loadManifest, all files are seen and loaded correctly, but it seems to skip all the audio files. Also, i don’t receive any kind of warnings. On what version of soundJS does the plugin work? eventually, where can i find informations about the cocoonjs audio API to do modifications to the plugins if necessary? thanks for your time :)

    Watacoso

    • watacoso

      ok nevermind, i found a solution xD i noticed that ogg wasn’t among the extensions attribute of the plugin. Out of curiosity i tried to add it, without
      really thinking it would work. but well, it did xD

      if you have .ogg files , just search for the part of the plugin where the capabilities attribute is filled and add playType == “ogg” to the list of extensions.

      the only problems i see is an error message for each of my registered sounds : “Could not find the audio file named “game/null” , and apparently i can play only one instance of a sound for each source. not really a problem for my current project, but i’ll see if i can find a solution. now my game runs without issues and i can upload it! again, thanks for this lib! :D

      • olsn

        awesome!
        thanks for sharing this!