SoundObject (Javadocs: Processing Sound) (original) (raw)
Direct Known Subclasses:
[AudioIn](AudioIn.html "class in processing.sound")
, [AudioSample](AudioSample.html "class in processing.sound")
, [Noise](Noise.html "class in processing.sound")
, [Oscillator](Oscillator.html "class in processing.sound")
public abstract class SoundObject extends Object
For advanced users: common superclass of all sound sources (oscillators, noise, audio samples and even AudioIn).
Method Summary
void
[add](#add%28float%29)(float add)
void
[amp](#amp%28float%29)(float amp)
Change the amplitude/volume of this sound.int
[channels](#channels%28%29)()
The 'true' number of underlying channels of this sound.
Gets the JSynCircuit
object which encapsulates all the JSyn units (basic sound generator, pan and amplitude) which control the sound synthesis of this SoundObject.boolean
[isPlaying](#isPlaying%28%29)()
Check if this sound object is currently playing.void
[pan](#pan%28float%29)(float pos)
Move the sound in a stereo panorama.void
[play](#play%28%29)()
void
[stop](#stop%28%29)()
Stops this sound from playing back.
Method Details
add
public void add(float add)
amp
public void amp(float amp)
Change the amplitude/volume of this sound.
Parameters:
amp
- A float value between 0.0 (complete silence) and 1.0 (full volume) controlling the amplitude/volume of this sound.isPlaying
public boolean isPlaying()
Check if this sound object is currently playing.
Returns:
`true` if this sound object is currently playing, `false` if it is not.pan
public void pan(float pos)
Move the sound in a stereo panorama.
Parameters:
pos
- The panoramic position of this sound unit as a float from -1.0 (left) to 1.0 (right).play
public void play()
Starts the generatorstop
public void stop()
Stops this sound from playing back.channels
public int channels()
The 'true' number of underlying channels of this sound. All SoundObjects are put into a stereo-pannable wrapper, but for multi-channel purposes, anything that's not a true stereo sample should be considered to be mono.
See Also:
* MultiChannelgetUnitGenerator
Gets the
JSynCircuit
object which encapsulates all the JSyn units (basic sound generator, pan and amplitude) which control the sound synthesis of this SoundObject.