JmolAudio
Date: 2019-10-22

org.jmol.util

## Class JmolAudio

- java.lang.Object
- - org.jmol.util.JmolAudio

- All Implemented Interfaces:
    java.util.EventListener, javax.sound.sampled.LineListener, JmolAudioPlayer

      public class JmolAudio
      extends java.lang.Object
      implements javax.sound.sampled.LineListener, JmolAudioPlayer

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private boolean` | `autoClose`
    `private java.lang.String` | `fileName`
    `private java.lang.String` | `id`
    `private static int` | `idCount`
    `private static int` | `MAX_LOOP`
    `private javax.sound.sampled.Clip` | `myClip`
    `private java.util.Map<java.lang.String,java.lang.Object>` | `params`
    `private Viewer` | `vwr`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JmolAudio()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `action(java.lang.String action)` Execute an action from load audio "xxxxx.wav" filter "id=a1 action=xxx"
    `private void` | `getClip()`
    `void` | `playAudio(Viewer vwr, java.util.Map<java.lang.String,java.lang.Object> htParams)` WAV only for application
    `void` | `processUpdate(java.lang.String type)`
    `void` | `update(javax.sound.sampled.LineEvent le)`

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

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

- - ### Field Detail

    - #### MAX_LOOP

          private static final int MAX_LOOP

      See Also:
        Constant Field Values

    - #### params

          private java.util.Map<java.lang.String,java.lang.Object> params

    - #### myClip

          private javax.sound.sampled.Clip myClip

    - #### fileName

          private java.lang.String fileName

    - #### vwr

          private Viewer vwr

    - #### id

          private java.lang.String id

    - #### idCount

          private static int idCount

    - #### autoClose

          private boolean autoClose

  - ### Constructor Detail

    - #### JmolAudio

          public JmolAudio()

  - ### Method Detail

    - #### playAudio

          public void playAudio(Viewer vwr,
                                java.util.Map<java.lang.String,java.lang.Object> htParams)

      WAV only for application
      Parameters:
        `vwr` -
        `htParams` -

    - #### getClip

          private void getClip()
                        throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### update

          public void update(javax.sound.sampled.LineEvent le)

      Specified by:
        `update` in interface `javax.sound.sampled.LineListener`

    - #### processUpdate

          public void processUpdate(java.lang.String type)

    - #### action

          public void action(java.lang.String action)

      Execute an action from load audio "xxxxx.wav" filter "id=a1 action=xxx"
      Specified by:
        `action` in interface `JmolAudioPlayer`
      Parameters:
        `action` - start -- back to the beginning and olay loop -- loop indefinitely (JavaScript) or up to 10 times (Java) and play play -- start from current position; opposite of PAUSE pause -- opposite of PLAY (not implemented: position-nn reposition to nnn ms) close -- close player