Results 1 to 2 of 2
  1.    #1  
    folks, i'm using the HTML5 audio. i'm having some trouble understanding what is exactly going on and figured someone could share some insight. a few concerns:

    • this.audioElement.load(); plays the music - i though it would just load it and .play() would then play it
    • how do i actually preload audio so it is crisp to start when called on (if i have several different sounds starting at different times)
    • do things like .currentTime work for webOS

    here's what i'm using:

    this.audioPlayer = new Audio();
    this.audioPlayer.palm.audioClass = Media.AudioClass.MEDIA;
    this.audioPlayer.src = Mojo.appPath + "sounds/sound.wav";
    and then when i want to play the sound i use:

    again, i'm not sure why .load() is playing the sound, but it does. please let me know if anyone can shed some light on exactly what's going on, what i'm doing wrong, and what i need to do to make it right. should i even be using HTML5 audio? is there a better approach?

    My site: Shanerooni, LLC
    Follow me on Twitter
    My apps: GuessWhat? | MazeHunter3D | Small Wonders | PhakePhoney | AutismAware | PicSketcher | Cubix | QuickSolve | QuickSpell | QuickTrace | QuickWhack | QuickSuite | Soccer Shots | Ballooning |
  2. #2  
    In order for currentTime to work, you have to wait for the Playing (not Play) event. Once that's been fired, you can set currentTime with no problems. If you try before that, you'll get an error.

    For your load vs play issue, I forget exactly what order I use for .load, .play, etc. and I don't have my code in front of me. I'll look tonight. In my case, I am trying to load and play the track immediately, so my approach may not suit your needs.

Tags for this Thread

Posting Permissions