#12001/3/12 16:18:36
21.soundEnabled
语法 the soundEnabled
描述 System property; determines whether the sound is on (TRUE, default) or off (FALSE).
系统属性;确定声音是否正在播放
When you set this property to FALSE, the sound is turned off, but the volume setting is not changed.
当你将这个属性设为FALSE,声音被关闭,但音量设置没有被改变。
This property can be tested and set.
属性可以被检验和设置。
例子 This statement sets soundEnabled to the opposite of its current setting; it turns the sound on if it is off and turns it off if it is on:
这个语句设置soundEnabled为当前设置的值取反;当声音为关闭时打开,当声音为打开时关闭
the soundEnabled = not(the soundEnabled)
参见 soundLevel, volume (sound channel), volume (sprite property)
22.sound fadeIn
语法 sound(whichChannel).fadeIn()
sound fadeIn whichChannel
sound(whichChannel).fadeIn(ticks)
sound fadeIn whichChannel, ticks
描述 Command; fades in a sound in the specified sound channel over a period of frames or ticks.
命令;在一定时间的帧或tick时间内让指定声音通道的声音淡入。
When ticks is specified, the fade in occurs evenly over that period of time.
When ticks is not specified, the default number of ticks is calculated as
15 * (60 / (tempo setting)) based on the tempo setting for the first frame of the fade in.
当ticks被指定时, 淡入在这一段时间里均匀地的出现。
当ticks没有被指定时,缺省的ticks数基于帧速15*(60/(帧速))设置用于第一帧的淡入。
The fade in continues at a predetermined rate until the number of ticks has elapsed, or until the sound in the specified channel changes.
淡入在预定的速度上继续直到ticks数过去,或直到指定通道里的声音改变。
例子 This statement fades in the sound in channel 1 over 5 seconds:
这个语句让通道一里的声音在五秒里淡入。
sound(1).fadeIn(5 * 60)
参见 sound fadeOut, fadeTo()
23.sound fadeOut
语法 sound(whichChannel).fadeOut()
sound fadeOut whichChannel
sound(whichChannel).fadeOut(ticks)
sound fadeOut whichChannel, ticks
描述 Command; fades out a sound in the specified sound channel over a period of frames or ticks.
命令;在一定时间的帧或tick时间内让指定声音通道的声音淡出。
When ticks is specified, the fade out occurs evenly over that period of time.
When ticks is not specified, the default number of ticks is calculated as
15 * (60 / (tempo setting)) based on the tempo setting for the first frame of the fade out.
当ticks被指定时, 淡入在这一段时间里均匀地的出现。
当ticks没有被指定时,缺省的ticks数基于帧速15*(60/(帧速))设置用于第一帧的淡入。
The fade out continues at a predetermined rate until the number of ticks has elapsed, or until the sound in the specified channel changes.
淡入在预定的速度上继续直到ticks数过去,或直到指定通道里的声音改变。
If the sound is stopped before it reaches the minimum volume, it remains at the level it was stopped at, causing subsequent playback to be at this volume. Be sure to allow the sound to finish fading completely.
如果声音在延伸到最小音量前停止,它将保留停止时的音量大小,以至于后面回放的音量大小等于它。请确认声音淡出完全结束。
Note: You may want to use the volume sound property to create a custom sound fade to allow more control over the actual volume of the channel.
注意:你可以使用一个音量属性去建立一个自定义声音淡出去允许在通道的当前音量上进行更多的控制。
例子 This statement fades out the sound in channel 1 over 5 seconds:
这个语句让通道一里的声音在五秒里淡出。
sound(1).fadeOut(5 * 60)
参见 puppetSound, sound fadeIn, volume (sprite property), fadeTo()
soundKeepDevice
语法 the soundKeepDevice
描述 System property; for Windows only, prevents the sound driver from unloading and reloading each time a sound needs to play. The default value is TRUE.
系统属性;只用于Windows,防止每次一个声音需要播放里对声音设备进行卸载和重载。缺省值为TRUE.
You may need to set this property to FALSE before playing a sound to ensure that the sound device is unloaded and made available to other applications or processes on the computer after the sound has finished.
Setting this property to FALSE may adversely affect performance if sound playback is used frequently throughout the Director application.
This property can be tested and set.
例子 This statement sets the soundKeepDevice property to FALSE:
set the soundKeepDevice = FALSE