<?php
$first = rand(0,12);
$second = rand(0,12);
$answer = $first * $second;
$sounds = "./sounds/";
$answer_audio = array();
$times = "./sounds/times.wav";
$equals = "./sounds/equals.wav";
$first_sound = $sounds . $first . ".wav";
$second_sound = $sounds . $second . ".wav";
$answer_sound = $sounds . $answer . ".wav";
$audio1 = "<embed hidden = 'true' src='".$first_sound."'>";
$audio2 = "<embed hidden = 'true' src='".$times."'>";
$audio3 = "<embed hidden = 'true' src='".$second_sound."'>";
$audio4 = "<embed hidden = 'true' src='".$equals."'>";
$audio5 = "<embed hidden = 'true' src='".$answer_sound."'>";
echo $audio1;
echo $audio2;
echo $audio3;
echo $audio4;
echo $audio5;
?>
1 Replies - 834 Views - Last Post: 06 December 2010 - 05:49 PM
#1
How do you queue audio files to play in a given order?
Posted 06 December 2010 - 05:45 PM
I am working on a personal project utilizing sound files. Right now, I have a directory of sound clips, the program selects a group of five of these and is supposed to play them back in a specific order, however, it is playing it all back at the same time. All five sound at once. How do you get it to play the first, then second, etc. with maybe a slight pause in between?
Replies To: How do you queue audio files to play in a given order?
#2
Re: How do you queue audio files to play in a given order?
Posted 06 December 2010 - 05:49 PM
PHP treats HTML as a normal String. Once the PHP script finishes, then the HTML is displayed on the browser. You'll probably want to use something client-side like Javascript to queue the sounds.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote






|