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 7941087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:33:40+00:00 2026-06-03T23:33:40+00:00

I am using php to generate javascript that creates and plays sounds like: $playsound

  • 0

I am using php to generate javascript that creates and plays sounds
like:

$playsound .= "var $sound = new Audio('http://$siteurl/sounds/$sound.ogg'); soundplayer($sound $whentostart, $whentostop);   ";

soundplayer is a javascript function that takes the sound name, and durations of when to start and stop as parameters.

The problem I have is I have groups of soundplayer(with params) that I want to play together…ie certain groups play sounds at the same time. Then other groups that I need to start at some interval after.

For example:
This group plays:
soundplayer(with params)
soundplayer(with params)

Some time between say 1 to 4 seconds

Then this group plays:
soundplayer(with params)
soundplayer(with params)

then repeat for as many groups

What can I do in either jquery or javascript to wrap each function call to soundplayer() groups to get each group to play with specific intervals in between?

  • 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-03T23:33:41+00:00Added an answer on June 3, 2026 at 11:33 pm

    You can do that with either setTimeout (chaining) or setInterval (which repeats until you stop it).

    In JavaScript, and conceptually, to keep things simple:

    // Put the things you want to do in a function
    function doThingsInOrder() {
        doOneThing('someArgument');
        doAnotherThing();
        doAThirdThing('someArgument');
        // Maybe one of them should be delayed a bit
        setTimeout(doADelayedThing, 200); // 200 = 200ms = 1/5th second
    }
    
    // Call the function every four seconds, forever
    setInterval(doThingsInOrder, 4000);
    

    That’s the setInterval version. The setTimeout version just involves doThingsInOrder calling itself via setTimeout at the end:

    // Put the things you want to do in a function
    function doThingsInOrder() {
        doOneThing('someArgument');
        doAnotherThing();
        doAThirdThing('someArgument');
        // Maybe one of them should be delayed a bit
        setTimeout(doADelayedThing, 200); // 200 = 200ms = 1/5th second
    
        // Set up next call
        setTimeout(doThingsInOrder, 4000);
    }
    
    // Start the process off
    setTimeout(doThingsInOrder, 4000);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using PHP to generate a Javascript button that adds in a checkbox and
Im using http://www.ashberg.de/php-barcode/ scripts to generate a barcode. I now need to import the
I'm using php to generate an html page that displays blog/thread items, and I
I'm trying to parse the rows in a table that I generate using Javascript
I´m trying using php to generate a set of {URL.callback} to use in javascript.
I have a PHP script that I am using to generate some rather complicated
I'm using PHP to generate feeds, which is working perfectly fine on my local
I actually want to generate random password using PHP uniqid() function $randomPassword = uniqid();
I'm using a compination of actionscript's getPixel and php's imagecreatetruecolor and imagesetpixel to generate
I'm creating a JSON object like tags = {jon:[beef,pork],jane:[chicken,lamb]}; which was generated using php

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.