Package processing.sound
Class SoundObject
java.lang.Object
processing.sound.SoundObject
- Direct Known Subclasses:
AudioIn,AudioSample,Noise,Oscillator
For advanced users: common superclass of all sound sources (oscillators,
noise, audio samples and even AudioIn).
-
Method Summary
Modifier and TypeMethodDescriptionvoidadd(float add) voidamp(float amp) Change the amplitude/volume of this sound.intchannels()The 'true' number of underlying channels of this sound.Gets theJSynCircuitobject which encapsulates all the JSyn units (basic sound generator, pan and amplitude) which control the sound synthesis of this SoundObject.booleanCheck if this sound object is currently playing.voidpan(float pos) Move the sound in a stereo panorama.voidplay()Starts the generatorvoidstop()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 generator -
stop
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:
-
getUnitGenerator
Gets theJSynCircuitobject which encapsulates all the JSyn units (basic sound generator, pan and amplitude) which control the sound synthesis of this SoundObject.
-