Class SoundObject

java.lang.Object
processing.sound.SoundObject
Direct Known Subclasses:
AudioIn, AudioSample, Noise, Oscillator

public abstract class SoundObject extends Object
For advanced users: common superclass of all sound sources (oscillators, noise, audio samples and even AudioIn).
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(float add)
     
    void
    amp(float amp)
    Change the amplitude/volume of this sound.
    int
    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
    Check if this sound object is currently playing.
    void
    pan(float pos)
    Move the sound in a stereo panorama.
    void
    Starts the generator
    void
    Stops this sound from playing back.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public JSynCircuit getUnitGenerator()
      Gets the JSynCircuit object which encapsulates all the JSyn units (basic sound generator, pan and amplitude) which control the sound synthesis of this SoundObject.