Wednesday, February 12, 2014

Script: Play Soundclip from 12 via menu

:: BLACK TULIP PLAY SOUND CLIP FROM 12 - MENU ::
:: Play one from at most 12 sound clips in the object ::


(Only available inworld)
By Auryn Beorn (2011)

TABLE OF CONTENTS



PURPOSE AND FEATURES


This box contains two full permissions scripts:

  • [Black Tulip] Play Soundclip from 12 - Menu (AU)
  • [Black Tulip] Play Soundclip from 12 - Menu (OO)

Both scripts perform the same action: On touch, it shows a menu that allows you to select from at most 12 sound clips.
The difference between them is:

  • AU: All Users - Everybody will be able to use the menu by clicking the object.
  • OO: Owner Only - Only the owner of the object will be able to use the menu by clicking the object.

INSTALL AND USE YOUR PLAY SOUND CLIP SCRIPT


In order to have any of these scripts working in your object, you have to:

  • Drop in the object all the sound clips that you want to be selected from a menu.
  • Drop the one script you want to use, from the two scripts available in the box.

Use only ONE script from the four in the box!
The description in the previous section should help you decide which to use depending of your application.

VERY IMPORTANT: The sound clips contained in inventory should NOT have more than 24 characters in their name. If they do, the script will cut the name to show you the option, but then it won't be able to play it.

IMPORTANT: Don't forget to change permissions of these scripts AND your sound clips! Refer to the license of use for instructions to change the permissions of the script you use.

COMMON QUESTIONS


Q: The volume is too loud. May I change it? How?

Edit the script you will use and look for the following line:

float   volumeSound = 1.0;  // Ranges from 0.0 to 1.0

then change it to (an example):

float   volumeSound = 0.75;  // Ranges from 0.0 to 1.0

and save the script. From now on, the music will be played by using a volume of 75% of the total it can get.

Q: The sound clip is there, but when I click the button, the script says "There's no such soundclip contained in the object." What is it working wrong?

Refer to the "VERY IMPORTANT" note from the "INSTALL AND USE YOUR PLAY SOUND CLIP SCRIPT" section. Most likely, the reason for this problem is that your sound clip contains MORE than 24 characters in the name. Simply, shorten the name to fit this, and the script will acknowledge the sound.