Class SoundTile.Wave

  • Enclosing class:
    SoundTile

    public static class SoundTile.Wave
    extends java.lang.Object
    A wave which is generated / played back by a Sound Tile
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  SoundTile.Wave.Waveform
      The waveform used to generate a wave
    • Field Summary

      Fields 
      Modifier and Type Field Description
      float amplify
      Used to multiply the wave output value
      boolean enabled
      True if the waveform is active Only active waves will be generate sound
      float frequency
      Wave frequency
      java.lang.Float offset
      Phase offset 1 = one second
      SoundTile.Wave.Waveform waveform
      Waveform used to generate the wave
    • Constructor Summary

      Constructors 
      Constructor Description
      Wave()
      Create a new wave using the default values
      Wave​(float frequency, SoundTile.Wave.Waveform waveform)
      Create a new configured wave from frequently used options
      Wave​(float frequency, SoundTile.Wave.Waveform waveform, boolean enabled, java.lang.Float offset, float amplify)
      Create a new configured wave by setting all options
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String dataToString()
      Returns wave information as a string.
      java.lang.Object serializeData()
      Outputs the wave as a JSON object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • frequency

        public float frequency
        Wave frequency
      • enabled

        public boolean enabled
        True if the waveform is active Only active waves will be generate sound
      • offset

        public java.lang.Float offset
        Phase offset 1 = one second
      • amplify

        public float amplify
        Used to multiply the wave output value
    • Constructor Detail

      • Wave

        public Wave()
        Create a new wave using the default values
      • Wave

        public Wave​(float frequency,
                    SoundTile.Wave.Waveform waveform)
        Create a new configured wave from frequently used options
        Parameters:
        frequency - frequency of this wave
        waveform - waveform of this wave
      • Wave

        public Wave​(float frequency,
                    SoundTile.Wave.Waveform waveform,
                    boolean enabled,
                    java.lang.Float offset,
                    float amplify)
        Create a new configured wave by setting all options
        Parameters:
        frequency - frequency of this wave
        waveform - waveform of this wave
        enabled - whether this wave is enabled
        offset - phase offset of this wave. Set to null to not enforce an offset.
        amplify - amplification of this wave. Normal value range is [0,1].
    • Method Detail

      • serializeData

        public java.lang.Object serializeData()
        Outputs the wave as a JSON object.
        Returns:
        data serialized as a json object
      • dataToString

        public java.lang.String dataToString()
        Returns wave information as a string.
        Returns:
        string containing information about this wave