User Guide

566
Example
This statement displays the name and sampleCount of the cast member currently playing in sound
channel 1 in the Message window:
put "Sound cast member" && sound(1).member.name && "contains" && \
sound(1).sampleCount && "samples."
See also
channelCount, sampleRate, sampleSize
sampleRate
Syntax
member(whichCastMember).sampleRate
the sampleRate of member whichCastMember
sound(channelNum).sampleRate
Description
Cast member property; returns, in samples per second, the sample rate of the sound cast member
or in the case of SWA sound, the original file that has been Shockwave Audio–encoded. This
property is available only after the SWA sound begins playing or after the file has been preloaded
using the
preLoadBuffer command. When a sound channel is given, the result is the sample rate of
the currently playing sound cast member in the given sound channel.
This property can be tested but not set. Typical values are 8000, 11025, 16000, 22050,
and 44100.
When multiple sounds are queued in a sound channel, Director plays them all with the
channelCount, sampleRate, and sampleSize of the first sound queued, resampling the rest for
smooth playback. Director resets these properties only after the channels sound queue is
exhausted or a stop() command is issued. The next sound to be queued or played then
determines the new settings.
Examples
This statement assigns the original sample rate of the file used in SWA streaming cast member
Paul Robeson to the field cast member Sound Quality:
member("Sound Quality").text = string(member("Paul Robeson").sampleRate)"
This statement displays the sample rate of the sound playing in sound channel 1 in the
Message window:
put sound(1).sampleRate
sampleSize
Syntax
member(whichCastMember).sampleSize
the sampleSize of member whichCastMember
sound(channelNum).sampleSize
Description
Cast member property; determines the sample size of the specified cast member. The result is
usually a size of 8 or 16 bits. If a sound channel is given, the value if for the sound member
currently playing in the given sound channel.
This property can be tested but not set.