pulpcore.sound
Class SoundSequence
java.lang.Object
pulpcore.sound.Sound
pulpcore.sound.SoundSequence
public final class SoundSequence
- extends Sound
A SoundSequence is a immutable sequence of sampled sounds that can be played together
smoothly with no skips or breaks between sounds. The sounds can be a mix of mono and
stereo Sounds, or other SoundSequences.
All sounds in a sequence must have the sample sample rate.
Method Summary |
int |
getNumFrames()
Gets the length of this sound, expressed in the number of frames. |
void |
getSamples(byte[] dest,
int destOffset,
int destChannels,
int srcFrame,
int numFrames)
Copies a sequence of samples from this Sound to a byte array as
signed, little endian, 16-bit PCM format. |
Methods inherited from class pulpcore.sound.Sound |
getDuration, getSampleRate, getSampleSize, load, load, loop, loop, loop, play, play, play, play |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SoundSequence
public SoundSequence(Sound[] sounds)
- Throws:
IllegalArgumentException
- if not all sounds in the sequence have the same
sample rate.
getNumFrames
public int getNumFrames()
- Description copied from class:
Sound
- Gets the length of this sound, expressed in the number of frames. For mono sounds,
a frame is one sample, for stereo sounds, a frame consists of two samples - one for
the left channel, and one for the right channel.
- Specified by:
getNumFrames
in class Sound
getSamples
public void getSamples(byte[] dest,
int destOffset,
int destChannels,
int srcFrame,
int numFrames)
- Description copied from class:
Sound
- Copies a sequence of samples from this Sound to a byte array as
signed, little endian, 16-bit PCM format.
- Specified by:
getSamples
in class Sound
- Parameters:
dest
- the destination buffer.destOffset
- the offset, in bytes, in the destination buffer.destChannels
- The number of channels of the destination (1 or 2).srcFrame
- the frame position to start copying from.numFrames
- the number of frames to copy.
Copyright © 2007-2009 Interactive Pulp, LLC.