User Guide

966 Chapter 14: Properties
sampleCount
Usage
-- Lingo syntax
soundChannelObjRef.sampleCount
// JavaScript syntax
soundChannelObjRef.sampleCount;
Description
Sound Channel property; specifies the number of sound samples in the currently playing sound
in a sound channel. Read-only.
This is the total number of samples, and depends on the
sampleRate and duration of the
sound. It does not depend on the
channelCount of the sound.
A 1-second, 44.1 KHz sound contains 44,100 samples.
Example
This statement displays the name and sampleCount of the cast member currently playing in
sound channel 1 in the Message window:
-- Lingo syntax
put("Sound cast member" && sound(1).member.name && "contains" && \
sound(1).sampleCount && "samples.")
// JavaScript syntax
put("Sound cast member " + sound(1).member.name + " contains " +
sound(1).sampleCount + " samples.");
See also
sampleRate, Sound Channel
sampleRate
Usage
-- Lingo syntax
soundChannelObjRef.sampleRate
// JavaScript syntax
soundChannelObjRef.sampleRate;
Description
Sound Channel 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.
Read-only.
This property is available only after the SWA sound begins playing or after the file has been
preloaded using the
preLoadBuffer() method. When a sound channel is given, the result is the
sample rate of the currently playing sound cast member in the given sound channel.
Typical values of this property are 8000, 11025, 16000, 22050, and 44100.