Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8043691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:59:12+00:00 2026-06-05T04:59:12+00:00

Hey guys i build a AudioQueue for my game and somehow it doenst work,

  • 0

Hey guys i build a AudioQueue for my game and somehow it doenst work, code:

handleAction: function ( src )
    {
        var oAudio = document.getElementById('voice');

        if(this.lastSoundPlayed == undefined || src != this.lastSoundPlayed.src) // checks if there is an actual new sound incoming.
        {
            var self  = this;
            oAudio.src = src; //sets the source
            oAudio.load();
            oAudio.onloadeddata  = oAudio.play(); // when loaded play the sound
            oAudio.onended = self.soundDone( self, oAudio ); //when the sound is finished fire the soundDone function
        }
    }

the soundDone() function:

soundDone: function( self , oAudio )
    {
        console.log("Finished"); //logs that the sound is finished
        self.lastSoundPlayed = oAudio; //sets the lastSoundPlayed
        self.sendNotification(self.SC_ACTION_COMPLETE); //fires off a notification that the sound is finished (im using pureMVC)
    }

well the actual problem is that he thinks that the sounds is instant finished. ive logged the duration of my sounds and there all NaN? i’ve checked that with console.log(oAudio.duration). i dont know why this is happening. i also have background music wich i play the same way as these sounds and with the background music is nothing wrong.

Someone can help me?

EDIT: this is the audio tag for my audio:

<audio id="voice" src="mySound.mp3" controls preload="auto" ></audio>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T04:59:13+00:00Added an answer on June 5, 2026 at 4:59 am

    found it couple of weeks ago, the sounds wasnt fully loaded when i called it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hey guys I have the follow code in js: $(document).ready(function(){ $(.replyLink).click(function(){ $(#form-to-+this.id).html(htmlForm()).toggle(500); return false;
Hey guys, I've been trying to build something simple in Flash 8, and I
Hey guys. Check out this piece of sample code. #include stdafx.h #include<conio.h> #include<string.h> class
Hey guys, take a look at this, maybe you can help me. This code
Hey guys I am making a 2D game and I have generating a random
Hey guys I am trying to build a database that maps NSStrings to int.
Hey guys I am trying to build a signature task application . In which
Hey guys i'm trying to build a little app that pulls in the users
hey guys, I'm trying to build a simple custom select box with jquery. html:
Hey guys, I am trying to build an app that will use a compass

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.