Main Page About Ldoc+ Error Lists Main Index Index Groups

Ldoc+ Lingo Group:
    SOUNDs /SWA

 info D5/601:
      puppetSound
      sound playFile
      mySoundFadeOut()
 6    MANY elements new in Director 6.0,
  !   SOME contain Dictionary fixes 601 & 501,
   +  MANY miss from the 'Appendix' 6.0 for SOUND,
   +  SOME miss from the 'Appendix' 6.0 for SWA.


General Sound Elements (8):
   +  beepOn
   +  frameSound1
   +  frameSound2
   +  multiSound (stereo)
      soundBusy()
      soundEnabled
  !+  soundLevel (0-7)
   +  volume of sound (0-255)

Sound Commands (8):
   +  beep
   +  mci "string" (Windows only)
  !   puppetSound
x6    sound close
  !   sound fadeIn
      sound fadeOut
  !   sound playFile (takes URLs)
      sound stop

--

Cue Points in AIFF, QuickTime & SWA (9):
 6 +  cuePointNames of member
 6 +  cuePointTimes of member
 6 +  currentTime        of sound
 6 +  currentTime        of sprite
 6 +  mostRecentCuePoint of sound
 6 +  mostRecentCuePoint of sprite
 6 +  isPassedCuePoint(sound...)
 6 +  isPassedCuePoint(sprite...)
 6 +  on cuePassed [me]

--

#digitalVideo QuickTime Audio (13):
   +  duration  of member   (test only)
   +  fileName  of member   (takes URLs)
   +  loop      of member
      sound     of member
      movieRate of sprite
      movieTime of sprite
   +  startTime of sprite
   +  stopTime  of sprite
      volume    of sprite   (0-255)
   +  volume    of sound    (0-255)
 6    digitalVideoTimeScale (default = 60)
   +  preLoadRAM
   +  quickTimePresent
      ...see also the DIGITAL VIDEOS Lingo Group.

#sound AIFF & WAVE Sounds (7):
 6 +  channelCount    of member  (test only)
   +  duration        of member  (test only)
   +  fileName        of member  (takes URLs)
   +  loop            of member
   +  sampleRate      of member  (test only)
   +  sampleSize      of member  (test only)
   +  volume of sound (0-255)

#SWA Shockwave Audio Sounds (22):
 6    bitsPerSample   of member  (test only)
 6    bitRate         of member  (test only)
 6    copyrightInfo   of member  (test only)
 6    duration        of member  (test only)
 6    numChannels     of member  (test only)
 6    percentPlayed   of member  (test only)
 6    percentStreamed of member  (test only)
 6    preLoadTime     of member  (best = 3)
 6    sampleRate      of member  (test only)
 6    soundChannel    of member  (1 - 8)
 6    state           of member  (test only)
 6    streamName      of member  (takes URLs)
 6    URL             of member  (takes URLs)
 6    volume          of member  (0-255)
   +  volume of sprite (0-255)
   +  volume of sound  (0-255)
 6    getError()
 6    getErrorString()
 6    pause(member)
 6    play(member)
 6    preLoadBuffer(member)
 6    stop(member)

--

Outdated SOUND Lingo (1):
 6               sound close -> sound stop / puppetSound channel1to8,0





[index] _ D5/601 _ 971224:


puppetSound

sound controlling command

6.0 Dictionary Errors, partly the same in 5.0:

"When the sound is a puppet, Lingo can override...
 the Score's sound channels."
= Not correct; should read:
"When sound channel 1 or 2 are puppeted, Lingo can override...
 the TWO sound channels in the Score."

"The sound starts playing after...'updateStage' command is executed."
= Not exact; should read:
"When 'puppetSound' is used without a channel number parameter,
 the sound starts playing after...'updateStage' command is executed,
 as soon as it has been loaded into memory, otherwise the sound
 starts playing right after being loaded into memory."

= Missing:
"Sounds need to be fully loaded into memory before they can play, which
 can cause a movie delay depending on the size of the sound. To instead
 stream sound files from disk, use the 'sound playFile' command or turn
 the sounds into audio-only QuickTime video files."

"It also returns control of the sound channel to the Score."
= Not enough; should read:
"It also returns control of the SPECIFIED sound channel for the
 following frames to the Score. If a sound is already in the
 specified sound channel in that frame, it will NOT start playing."

= Missing:
"Stereo sounds do play in stereo, but they only occupy
 one single sound channel (1 to 8)."

= Missing:
"On Macintosh, Director by default offers 8 sound channels.
 On Windows, Director only offers 4 sound channels by default,
 but you can enable all 8 channels by copying the DIRECTOR.INI
 file to a file with the name of you projector and editing
 the sound section in it. Place this file next to your projector."

= Missing:
"On Windows, delays of one half up to 2 seconds can occur,
 when a (looping) sound is already playing in one channel
 and another sound is played on top of it."

= Missing:
"On Windows, an audio sound cannot be played together with a
 digital video, and vice versa. Stop the playing media before
 starting a different sound type."

= Missing:
"Director does not support compressed .WAV sound files (output of
 some Windows sound programs). Save problematic .WAV sounds as
 uncompressed files in a sound application and then try them
 again with Director."

"This statement plays the sound Wind under control of Lingo:
 'puppetSound "Wind"' "
= Not exact; Example 1 should read:
"This statement plays the sound 'Wind' under control of Lingo
 in the default sound channel 1:
 'puppetSound "Wind"' "

"This statement turns off the sound playing in channel 2:
 'puppetSound 2, 0' "
= Not enough; Example 2 should read:
"This statement turns off the sound playing in sound channel 2
 and returns control over that sound channel for the following
 frames back to the Score:
 'puppetSound 2, FALSE' "

= Missing:
"See Also: ... soundBusy() function, volume of sound,
 the soundLevel, the soundEnabled, the multiSound"
 --

From the '6.0 ReadMe':
  External Sounds:
  The second paragraph for 'puppetSound' describing how Director
  puppets internal and linked sounds is incorrect. You can specify
  either a linked or an internal sound to play in any sound channel
  by specifying the sound channel. The second paragraph should say:
  "For sound castMembers, specify a sound channel by replacing
  'whichChannel' with a channel number from 1 to 8."

  Memory Inspector and Sound Files:
  The Memory Inspector will include any linked sounds that are referenced
  via lingo or the Score when reporting "Total Used" and "Cast and Score"
  memory consumption. This data is inaccurate. Linked sounds that are
  placed in the Score or played using 'sound playFile' will stream from
  disk, rather than being completely loaded into RAM as reported
  by the Memory Inspector.

  External Sound Editors:
  Using 'Launch & Edit' on Sounds (or QuickTime members) to launch
  external editors other than SoundEdit 16 v. 2.0.4 or greater (Macintosh
  only) will cause the sounds to lose their media sync points.
  SoundForge for Windows will only recognize 8-character filenames.
  To perform an external edit of sounds in this editor, verify that
  the cast member to be edited is named with 8 or fewer characters.

  Cue Points:
  You cannot create cue points on Windows. Adding cue points to sound
  or video files must be done in SoundEdit 16 version 2.0.4 or greater.
  Currently SoundEdit 16 is available on Macintosh only. Director will
  read cue points in Quicktime, AIFF, and SWA on both Mac and Windows.

  Shockwave SWA Sounds:
  'Save As Shockwave' will temporarily increase the file size of the
  original movie (.DIR) by the size of the internal sounds which are
  compressed. This increase is only temporary. Applying 'Save and Compact'
  to the .DIR file will return it to its original size (or smaller).
  This is also true when creating .DCRs using the Update Movies dialog box.
  Make sure the source movie is not locked and does not reside on a locked
  volume before saving as a shockwave movie.  
  --

From 'Macromedia Director Corrections':
  The description of linked sound castMembers is inaccurate.
  Linked sound castMembers can play in any channel.
  --

"Use 'puppetSound' to restore control of the sound channel
 to the Score."
= The 5.0 Dictionary should read:
"Use 'puppetSound 0' to restore control of the FIRST sound channel
 to the Score, use 'puppetSound channel1to8, FALSE' for other channels."
 --

1. TIP: The 'puppetSound' command has two flavors:
a) 'puppetSound soundName' only plays a named sound member in the first sound channel, and needs a stage update to start it playing;
a) 'puppetSound channel1to8, whichSoundMember' can take an integer number from 1 to 8 for the sound channel, and a name or number of a member to play, and it will start playing the sound member immediately without a stage update. In 5.0, you CANNOT use 'puppetSound 1, whichSoundMember' for the FIRST sound channel, at least not on my Macintosh.

2. TIP: Remember: If you use 'puppetSound' with linked external AIFF sound members, they CANNOT play their own individual looping points (created on Macintosh in Macromedia's SoundEdit 16 v. 2.0.4 or greater). They will also be fully loaded into memory before they play. See more info and tips at 'sound playFile'.

3. TIP: Test 'soundBusy(channel1to8)' after the sound started to play to see if your sound is still playing.

4. TIP: To turn off the puppet of a sound channel, use 'puppetSound channel1to8, FALSE' (no stage update needed); only the first sound channel can be de-puppetized using 'puppetSound 0'. The 'sound stop' command (as well as the outdated 'sound close') will NOT turn off the puppet of a sound channel, they'll just cut off the sound.

5. TIP: Director can play and mix a maximum of 8 sound channels, but channels 3 to 8 can only be controlled through Lingo by using 'puppetSound x, whichSoundMember', or by using the command 'sound playFile channel1to8, (the pathName & soundFileName)', which plays an external sound file by streaming it from disk (the 'sound playFile' CANNOT loop a sound!). Although you have 8 sound channels available, it's recommended to only use a maximum of 3 or 4, because Director (or the Operating System) might choke on more.

6. TIP: If you use 'puppetSound channel1or2, FALSE' without having started a sound before with the 'puppetSound' command, also sounds playing in that sound channel of the Score will stop, but a 'go to...' looping command will restart that Score sound.

7. TIP: There is no use in playing any sounds or loading them into memory at all, if 'the soundEnabled = FALSE' or 'the soundLevel = 0', because that will take time but have no effect. Best to use a global flag variable like 'gSoundOn' and 'set gSoundOn = the soundEnabled', or set it to FALSE if 'the soundLevel = 0', and then only play sounds 'if (gSoundOn) then...'. This should apply to 'the multiSound' as well, as either the user will have a STEREO sound card, or none, in which case 'the multiSound = FALSE'. I have even experienced a WindowsNT computer without a sound card keeping 'the soundLevel = 0' no matter what I tried in Director 601... ;-)

8. TIP: On Windows, a digital video sound CANNOT play when an audio sound is already playing, and vice versa. Remember: Using 'sound stop' does NOT de-puppetize the specified sound channel (1 to 8) if you used 'puppetSound' with that sound channel before.

9. TIP: Director does not support compressed .WAV sound files (output of some Windows sound programs). Instead save problematic .WAV files as uncompressed files in a sound application and then try them again in Director.

10. TIP: When jumping to another movie, do NOT keep a sound playing which is residing in an external castLib and is also used in the second movie, because when the second movie tries to load that (busy) sound, it will find a kind of '#empty' castMember slot, and will report back a 'sampleRate of member' of 0 for that sound member. Macromedia's Knowledgebase (KB) describes it like this:
"This problem will arise only if the sound member is being played as the next movie is navigated to. The problem is that Director loads the movie file and then the external casts. It sees that cast member is in use and can't get the file information on it so it assumes 0 bit depth and 0 sample rate. Workaround: test the samplerate or the samplesize of member, if it is = 0 then unloadmember by using 'if the sampleRate of member "mysound" = 0 then unloadmember "mysound"'. This will refresh the cast member information."

--

EXAMPLEs:

puppetSound "My1sound"
updateStage
--
--> ...the sound starts playing in the first sound channel.

puppetSound 1, the number of member "My2sound"
puppetSound 2, member "My3sound"
--
--> ...both new sounds start playing immediately!

--> Now lets turn off the sounds and their puppetting:
--
puppetSound 0
puppetSound 2, FALSE
--
put soundBusy(1)
-- 0
put NOT soundBusy(2)
-- 1





[index] _ D5/601 _ 971224:


sound fadeIn

sound fading in command

6.0 Dictionary Error, same in 5.0:

= Missing:
"See Also: ...  puppetSound, sound playFile, sound stop,
 soundBusy(), volume of sound"
 --

From the '6.0 ReadMe':
  'sound fadeIn' is handled slightly differently in Director 6.
  When a lingo 'sound fadeIn' occurs, sounds now fade in to the
  volume specified in the most recent 'volume of sound channel1to8'
  command. Existing productions will require minor alterations to the
  lingo preceding the 'sound fadeIn' if they want the older behavior.
  Adding 'puppetSound channel1to8, FALSE' followed by
  'set the volume of sound channel1to8 = 255' before the
  'sound fadeIn channel1to8, seconds' statement will cause
  Director 6 movies to act like Director 5.
  --

1. TIP: No stage update is needed, but the CPU needs to have free time to fade sound; if you keep the CPU busy with other things in the meantime, the processor cannot work on fading the sound output.

2. TIP: Best to issue a 'sound fadeIn channel1to8, timeInTicks' BEFORE playing the sound, otherwise it will cut off the playing sound and then fade it back in again.

3. TIP: See also 'sound fadeOut' and 'puppetSound', and mySoundFadeOut() for a sound fading handler using the 'volume of sound'.






[index] _ D5/601 _ 971224:


sound fadeOut

sound fading out command

6.0 Dictionary Error, same in 5.0:

= Missing:
"The volume of a faded sound channel will stay down at 0,
 until a new sound is played. If the sound is stopped before
 the fading has finished, the 'volume of sound' for that sound
 channel will stay at the reached level."

= Missing:
"See Also: ...  puppetSound, sound playFile, sound stop,
 soundBusy(), volume of sound"
 --

1. TIP: No stage update is needed, but the CPU needs to have free time to fade sound; if you keep the CPU busy with other things in the meantime, the processor cannot work on fading the sound output.

2. TIP: Remember: If you use the 'sound fadeOut' command, your audio source is still playing and keeping 'soundBusy(channel1to8)' to TRUE, though you don't hear the actual sound anymore.

3. TIP: The volume of a faded sound channel will stay down at 0, until a new sound is played.
John Dowdell from Macromedia Tech Support:
"Note that if explicitly fading a sound, you must allow it to fade... if you cut it out before it finishes fading then that truncated volume will remain."

4. TIP: See also 'sound fadeIn' and 'puppetSound', and mySoundFadeOut() for a sound fading handler using the 'volume of sound'.






[index] _ D5/601 _ 971224:


sound playFile

external sound playing command

6.0 Dictionary Errors, partly the same in 5.0:

"...using the 'sound playFile' command when playing digital video..."
= Not exact; should read:
"...using the 'sound playFile' command when playing digital video on Macintosh..."

= Missing:
"On Windows, Director can't play audio sound together with digital video
 or with audio-only QuickTime at the same time. The media that plays first
 will occupy Windows' only audio channel. Stop the media before playing
 a sound of a different type."

= Missing:
"Stereo sounds do play in stereo, but they only occupy
 one single sound channel (1 to 8)."

= Missing:
"On Macintosh, Director by default offers 8 sound channels.
 On Windows, Director only offers 4 sound channels by default,
 but you can enable all 8 channels by copying the DIRECTOR.INI
 file to a file with the name of you projector and editing
 the sound section in it. Place this file next to your projector."

= Missing:
"On Windows, an audio sound cannot be played together with a
 digital video, and vice versa. Stop the playing media before
 starting a different sound type."

= Missing:
"On Windows, delays of one half up to 2 seconds can occur,
 when a (looping) sound is already playing in one channel
 and another sound is played on top of it."

= Missing:
"Director does not support compressed .WAV sound files (output of
 some Windows sound programs). Save problematic .WAV sounds as
 uncompressed files in a sound application and then try them
 again with Director."

'sound playFile 1, "Thunder" '
= Example 1 should be Windows 3.1 compatible:
'sound playFile 1, "THUNDER.WAV" '

'sound playFile 3, the pathname & "Thunder" '
= Example 2 should read:
'sound playFile 3, (the pathname & "THUNDER.AIF")'

= Missing:
"See Also: ... soundBusy() function, volume of sound, sound fadeIn,
 sound fadeOut, the soundLevel, the soundEnabled, the multiSound"
 --

From the '6.0 ReadMe':
  Linked sounds that are placed in the Score or played using
  'sound playFile' will stream from disk, rather than being completely
  loaded into RAM as reported by Director's Memory Inspector window.
  --

1. TIP: No stage update needed when using 'sound playFile channel1to8, (the pathName & soundFileName)'. Remember to add 'the pathName' to the name of the external sound file, and best to enclose the whole expression in parenthesis.

2 TIP: The 'sound playFile' command returns -43 if the external sound file is not found (501 on Macintosh). Test 'the result' to possibly put up an alert.

3. TIP: Test 'soundBusy(channel1to8)' to see if your streaming sound is still playing.

4. TIP: Use 'sound stop channel1to8' to stop the streaming sound file.

5. TIP: No sound looping is possible when using the 'sound playFile' command, even if the external AIFF sound contains its own loop points (created on Macintosh in Macromedia's SoundEdit 16 v. 2.0.4 or greater).

6. TIP: Remember: The 'sound playFile' command streams the audio file (AIFF or WAV) from disk just like a video, and the sound is NOT loaded into memory, so you don't need to care about unLoading it.

7. TIP: There is no use in playing any sounds or loading them into memory at all, if 'the soundEnabled = FALSE' or 'the soundLevel = 0', because that will take time but have no effect. Best to use a global flag variable like 'gSoundOn' and 'set gSoundOn = the soundEnabled', or set it to FALSE if 'the soundLevel = 0', and then only play sounds 'if (gSoundOn) then...'. This should apply to 'the multiSound' as well, as either the user will have a STEREO sound card, or none, in which case 'the multiSound = FALSE'. I have even experienced a WindowsNT computer without a sound card keeping 'the soundLevel = 0' no matter what I tried in Director 601... ;-)

8. TIP: Director does not support compressed .WAV sound files (output of some Windows sound programs). Save problematic .WAV sounds as uncompressed files in a sound application and then try them again with Director.

9. TIP: On Windows, a digital video sound CANNOT play when an audio sound is already playing, and vice versa (see more info at 'sound stop').

10. TIP: See more sound info and tips at 'puppetSound'.






[index] _ D5/601 _ 971224:


sound stop

sound stopping command

6.0 Dictionary Errors, partly the same in 5.0:

"The 'sound stop' command was used in earlier versions..."
= Completely wrong; should read:
"The 'sound stop' command is useful to stop sounds playing in
 Score sound channels or with the 'sound playFile' command. To stop
 puppeted sounds from playing, use 'puppetSound channel1to8, FALSE'."  

...In opposition to what the docs say, the 'sound stop' command
   should not be considered as outdated, because it is still needed.
   Instead, the 'sound close' command is obsolete, as it works
   exactly the same way as 'sound stop' does.

"sound stop 1 .. sound close 1"
= Why twice? Example 1 just needs:
"sound stop 1"

= Missing:
"See Also: ... sound playFile, sound fadeOut, soundEnabled"
 --

1. TIP: No stage update is needed to let the 'sound stop channel1to8' command take effect.

2. TIP: Remember: Using 'sound stop' does NOT de-puppetize the specified sound channel (1 to 8) if you used 'puppetSound' with that sound channel before.

3. TIP: Using 'puppetSound channel1to8, FALSE' will also stop streaming sounds, and if used with channel 1 or 2, that will return the control over that sound channel for the following frames to the Score, although a sound in that score channel of the frame will not begin to play.

4. TIP: Remember: On Windows, use 'sound stop' to stop any audio sound playing, before you start to play a video. And stop any video (with sound), before playing audio (WAV or AIFF). Windows single sound channel can only handle one sound type (audio or video) at a time, and it will block the system's sound device for other types.






[index] _ D5/601 _ 971224:


soundEnabled

system sound property

6.0 Dictionary Errors, same in 5.0:

"This statement set turns to the opposite..."
= The Example should read:
"This statement turns the sound setting to the opposite..."

= Missing:
"See Also: ... volume of member (SWA), the multiSound"
 --

1. TIP: In 5.0, setting this sound property to TRUE will break off any sound playing at that time (setting it to FALSE will do that too, naturally). In 6.0, 'set the soundEnabled = TRUE' doesn't seem to interrupt a playing sound. Anyway, best workaround: 'if NOT (the soundEnabled) then set the soundEnabled = TRUE'.

2. TIP: If 'the soundEnabled = FALSE' or 'the soundLevel = 0', don't play or load any sounds! See TIPs at 'puppetSound'.






[index] _ D5/601 _ 971224:


soundLevel

system sound volume property

6.0 Dictionary Errors, worse in 5.0:

"...sound that is played through the computer's speaker."
= Take two! Should read:
"...sound that is played through the computer's speakerS."

"The default value is 7"
= Wrong! Should read:
"The default value depends on the System's volume setting.
 Values of more than 7 set 'the soundLevel' to 7, but values of
 less then 0 don not change the current 'soundLevel' setting. 

= Missing:
"When 'the soundLevel = 0' then there is no use to play sounds
 or to load them into memory, because they won't be heard anyway.
 Note: Setting 'the soundLevel = 0' also keeps the System
 sound volume turned off after Director or a projector quits.
 Best to store the original System's volume setting in a global
 variable and to restore the System volume setting before quiting."

= Missing:
"Setting 'the soundLevel' does not effect the value of 'volume
 of sprite', but determines the level at which the sound is heard."

"put the soundLevel into oldSound"
= Outdated use of 'put...into'! Should read:
"set oldSound = the soundLevel"

= Missing:
"See Also: ... volume of member (SWA), volume of sprite,
 the multiSound"
 --

Errors in the 5.0 Dictionary:

"Now that Macintosh computers can produce multichannel sound..."
= Should read:
"Now that finally some WINDOWS computers can..."  ;-)

"...this property is becoming obsolete."
= Wrong! Should read:
"Although 'the soundLevel' has its restricted levels from 0 to 7,
 it is still Director's general sound volume control. If you set
 'the volume of sound' instead of the overall 'soundLevel', you
 will not change the 'volume of sprite' for a digital video or
 a Shockwave Audio (SWA) sprite."
 --

1. TIP: On Windows, avoid turning 'the soundLevel' property up to the maximum of 7, because your sound might become distorted. Use a 'soundLevel' of 5 for normal projects. No problem on Macintosh, where the System's sound volume setting ranges from 0 to 7.

2. TIP: Test 'the soundEnabled' and 'the multiSound' to see if the system plays sound at all and if it's stereo. See TIPs at 'puppetSound'.

3. TIP: It's best to include a user volume controller in all your projects; a good habit is to have the number keys '1' through '0' on the keyboard to control 'the soundLevel'.






[index] _ D5/601 _ 971224:


volume of sound

sound channel property

6.0 Dictionary Errors, same in 5.0:

"Sound channels are numbered 1, 2, 3, and so on."
= Wow, 1001 sound channels? Should read:
"Sound channels are numbered 1 through 8."

= Missing:
"On Macintosh, Director by default offers 8 sound channels.
 On Windows, Director only offers 4 sound channels by default,
 but you can enable all 8 channels by copying the DIRECTOR.INI
 file to a file with the name of you projector and editing
 the sound section in it. Place this file next to your projector."

= Missing:
"Stereo sounds do play in stereo, but they only occupy
 one single sound channel (1 to 8)."

= Missing:
"Values of 0 or less are mute. The effect of the 'volume of sound'
 is relative to the setting of 'the soundLevel'. If 'the soundLevel'
 is 0 or FALSE, then no 'volume of sound' will be hearable."

"See Also:  fadeIn and fadeOut commands; ..."
= Not quite; should read:
"See Also:  sound fadeIn, sound fadeOut, sound stop,
 volume of member, volume of sprite; soundBusy() ..."
 --

1. TIP: The 'volume of sound channel1to8' is relative to the 'the soundLevel': if 'the soundLevel = 4', then a 'volume of sound' setting of 255 (maximum) plays the sound in that sound channel at the given soundLevel of 4, a 'volume of sound' setting of 128 (half) then plays with a loudness of a relative soundLevel of 2. If 'the soundLevel = 0', then also a 'volume of sound' of 255 will not be heard.

2. TIP: Remember: If you want to make sure the user gets to hear something while your movie is playing, check the active 'soundLevel' as well as the according 'volume of sound channel1to8', and if either of them is down to 0 (FALSE) then possibly turn them up (a little) to make things hearable.

3. TIP: If you'd like to convert the 'volume of sound' range from 0 to 255 to a range of 0 - 7 (like 'the soundLevel'), then a single step for 'the volume of sound' will be 37 units for each step: 255 / 7.0000 = 36.4 (exactly 36,4286 for Germans). ;-)

4. TIP: If you'd like to do a sound fading of your own for the 'volume of sound' of one or multiple sound channels, then be sure to add a pause of at least 1 tick between each fading step. You can also use an 'updateStage' to create a short delay between the steps. Increase the steps for faster fading. See the EXAMPLE below.

--

EXAMPLEs:

The following handler will fade all 8 sound channels (2 of which are in the Score) down to 0, then turn 'puppetSound' off for all, and finally restore the volume of each sound channel to its original setting. The fading finishes off on 'mouseDown'. You could also enhance this handler by controlling the number of the sound channel(s) to fade, the unit of each fading step, and the delay in ticks between each step by passing parameters to the handler. You could also create the appropriate 'mySoundFadeIn()' handler...

on mySoundFadeOut
  --
  set Chan1 = 1
  set ChanX = 8
  set Delay = 1  --> a slight pause between each step (change this value)
  set vUnit = 5  --> this is a medium fading step (change this value...)
  set vList = [ ]
  ---
  --> First save all specified sound channel volumes:
  --
  repeat with ii = Chan1 to ChanX
    setAt(vList, ii, the volume of sound ii)
  end repeat
  --
  set vMax = max(vList)  --> get the highest volume value...
  ---
  
  --> Now fade all the sound channels down simultanously step by step:
  --
  repeat while (vMax > vUnit)
    ----
    set vMax = vMax - vUnit
    --
    repeat with ii = Chan1 to ChanX
      set the volume of sound ii = (the volume of sound ii) - vUnit
      if (the mouseDown) then exit repeat
    end repeat
    --
    set delayTime = the ticks + Delay
    repeat while (the ticks < delayTime)
      if (the mouseDown) then exit repeat
    end repeat
    ---
    if (the mouseDown) then exit repeat
    --
  end repeat
  ----------
  
  --> Now stop all sound channels:
  --
  repeat with ii = Chan1 to ChanX
    set the volume of sound ii = 0
    sound stop  ii
    puppetSound ii, FALSE
  end repeat

  --> Finally restore the volumes to their original settings:
  --
  repeat with ii = Chan1 to ChanX
    set the volume of sound ii = getAt(vList,ii)
  end repeat
  --
end mySoundFadeOut





[index] _ D5/601 _ 971224:


volume of sprite

video sprite sound property

6.0 Dictionary Errors, same in 5.0:

"...used to control the volume of a digital video movie
 cast member."
= Missing:
"...used to control the volume of a digital video or a
 Shockwave Audio (SWA) castMember that's in a sprite channel."

"You can use a cast name or number."
= Totally stupid; delete it! That would be 'volume of member'.

"The values range from -256 to 256."
= Stupid! Should read:
"The values range from 0 (mute) to 255 (maximum volume)."

= Missing:
"Can be tested and set. The default value is 255."

= Missing:
"Stereo sounds do play in stereo, but they only occupy
 one single sound channel (1 to 8)."

= Missing:
"On Windows, an audio sound cannot be played together with a
 digital video, and vice versa. Stop the playing media before
 starting a different sound type."

= Missing:
"See Also: volume of member (SWA), volume of sound,
 the soundEnabled, the soundLevel"
 --

1. TIP: The 'volume of sprite' (0 to 255) plays relative to the 'the soundLevel': if 'the soundLevel = 4', then a 'volume of sprite' setting of 255 plays the video sound at a soundLevel of 4, a 'volume of sprite' setting of 128 plays at a loudness of a relative soundLevel 2. If 'the soundLevel = 0', then also a 'volume of sprite' of 255 will not be heard.

2. TIP: On Windows, a digital video sound CANNOT play when an audio sound is already playing, and vice versa (see more info at 'sound stop').

3. TIP: For more info and the 'mySoundFadeOut()' handler, see 'volume of sound'.





(Top)

URL = "http://www.a3w.de/Lingo/Ldoc_Sounds.html"  (980121)

 Top [Main Page] [About...] [Error Lists] [Ldoc+ Index] [Lingo Groups]
The Ldoc+ © Copyright 97-98 by Denis Wieger Online since June 1, 1997. All rights reserved.
<mailto:Denis@a3w.de
 Top