Skip to content

I am unable to get createjs.Sound to play sounds #4

@anagrath

Description

@anagrath

Sample code snippet:

sounds = [
      id: 'highlight', src: 'highlight.mp3'
    , 
      id: 'click_button', src: "click_button.mp3"
    ,
      id: 'flip', src: "flipOutX.mp3"
    , 
      id: 'pyro', src: 'pyro.mp3'
    , 
      id: 'confetti', src: 'confetti.mp3'
    ]
    createjs.Sound.registerSounds(sounds, "https://s3.amazonaws.com/mybucket/sounds/")
    setTimeout ->
      console.log "***************************** TRYING TO PLAY HIGHLIGHT!!!!! *************"
      sound = createjs.Sound.play 'highlight'    
      console.dir sound
    , 5000

This code works with another application that I wrote in angular. The current is using webpack with react. The canvas code using createjs works perfectly, and now I was going back to reimplement the sounds. I can see the sounds loading from the server with no error. I have a 5 second delay because I have some webspeech within this application and I wanted this to play after the webspeech in case that was interfering with the audio (or drowning it out). I also have a play attached to a button click... Neither play. output of the logs:

***************************** TRYING TO PLAY HIGHLIGHT!!!!! ************* 13:19:15.951 game_layout.js:278 WebAudioSoundInstance

I opened the object and confirmed the URL and everything looks normal. except for the "playState" field is "playFailed"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions