TQS Home
Trivia Quiz Shell Version 2.8 Now Available!Bot Productions Home
 
TQS 2.5

Back to Reference

playSoundFile Function

Plays the specified sound file.

Syntax
playSoundFile(fileName);
Parameters

fileName
Specifies the sound file to play.
Returns

There is no return value.

Remarks

In order for any sounds to be played, the TQS element's USESSOUNDS element must be set to "1".

The sound file must reside in the data root folder. This is, by default, the folder containing the .TQS file.

  • The data root folder can be set with the TQS element's DATAROOT attribute. To specify an absolute path, such as an Internet address, precede the path with NOROOT?.
  • TQS 2.6 To specify an embedded file, precede the path with EMBED?.

Use the playSound function to play the sound associated with a correct or an incorrect answer.

Examples

<DIVCODE XMLCOMPLIANT="1">
  ...
  <BUTTON onclick="onBtnClick(0)">Cow</BUTTON>
  <BUTTON onclick="onBtnClick(1)">Horse</BUTTON>
  <BUTTON onclick="onBtnClick(2)">Pig</BUTTON>
  ...
</DIVCODE>
function onBtnClick(btnID)
{
  playSoundFile("animal"+btnID+".wav");
}
function onBtnClick(btnID)
{
  playSoundFile("EMBED?animal"+btnID+".wav");
}


©2016 Bot Productions. All rights reserved.Last Updated: September 9, 2007