SoundClip

org.homebrew.engine

## Class SoundClip

- java.lang.Object
- - org.homebrew.engine.SoundClip

-     public class SoundClip
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private org.havi.ui.HSound` | `clip` sound clip
    `private java.lang.String` | `filename` filename of audio clip
    `private boolean` | `isLooping` is clip should loop

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SoundClip()` default constructor
    `SoundClip(java.lang.String filename)` overloading constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `private java.lang.String` | `getFilename()` returns the audio clips filename
    `private java.net.URL` | `getURL(java.lang.String filename)` Returns the url path of the file
    `boolean` | `isLoaded()` property to verify when sample is ready
    `boolean` | `isLooping()` returns if the audio clip is set to loop
    `boolean` | `load(java.lang.String audiofile)` loads the audio clip
    `void` | `play()` plays the audio clip
    `void` | `setFilename(java.lang.String filename)` Sets the filename of the audio clip
    `void` | `setLooping(boolean loop)` set if the audio clip should loop
    `void` | `stop()` stops an audio clip

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### clip

          private org.havi.ui.HSound clip

      sound clip

    - #### filename

          private java.lang.String filename

      filename of audio clip

    - #### isLooping

          private boolean isLooping

      is clip should loop

  - ### Constructor Detail

    - #### SoundClip

          public SoundClip()

      default constructor

    - #### SoundClip

          public SoundClip(java.lang.String filename)

      overloading constructor
      Parameters:
        `filename` - filename of audio clip

  - ### Method Detail

    - #### getFilename

          private final java.lang.String getFilename()

      returns the audio clips filename
      Returns:
        string audio clip filename

    - #### setFilename

          public final void setFilename(java.lang.String filename)

      Sets the filename of the audio clip
      Parameters:
        `filename` - name of audio clip file

    - #### isLooping

          public final boolean isLooping()

      returns if the audio clip is set to loop
      Returns:
        true if the clip is set to loop, otherwise false

    - #### setLooping

          public final void setLooping(boolean loop)

      set if the audio clip should loop
      Parameters:
        `loop` - boolean if the clip should loop

    - #### isLoaded

          public final boolean isLoaded()

      property to verify when sample is ready
      Returns:
        true if audio clip is loaded, otherwise false

    - #### getURL

          private final java.net.URL getURL(java.lang.String filename)

      Returns the url path of the file
      Parameters:
        `filename` - name of file to load
      Returns:
        URL url to file

    - #### load

          public final boolean load(java.lang.String audiofile)

      loads the audio clip
      Parameters:
        `audiofile` - file to load
      Returns:
        true if successful otherwise false

    - #### play

          public final void play()

      plays the audio clip

    - #### stop

          public final void stop()

      stops an audio clip