Class Sound

java.lang.Object
fr.r1r0r0.deltaengine.model.Sound

public final class Sound
extends java.lang.Object
A Sound class that contains audio clip.
  • Field Summary

    Fields
    Modifier and Type Field Description
    private java.io.File file  
    private java.lang.String name  
    private java.lang.String path  
    private double volume  
  • Constructor Summary

    Constructors
    Constructor Description
    Sound​(java.lang.String name, java.lang.String path)
    Default constructor.
  • Method Summary

    Modifier and Type Method Description
    java.io.File getFile()
    Get file descriptor for audio clip
    java.lang.String getName()
    Get the name of audio clip
    java.lang.String getPath()
    Get path of audio clip
    double getVolume()
    Returns current volume of audio clip

    Methods inherited from class java.lang.Object

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

    • name

      private java.lang.String name
    • path

      private java.lang.String path
    • file

      private java.io.File file
    • volume

      private double volume
  • Constructor Details

    • Sound

      public Sound​(java.lang.String name, java.lang.String path)
      Default constructor. Allows setting sound name and path to the audio clip
      Parameters:
      name - name of the audio
      path - path to the clip
  • Method Details

    • getVolume

      public double getVolume()
      Returns current volume of audio clip
      Returns:
      double volume (0 minimum, 1 maximum)
    • getName

      public java.lang.String getName()
      Get the name of audio clip
      Returns:
      String name of sound
    • getPath

      public java.lang.String getPath()
      Get path of audio clip
      Returns:
      String path of audio clip
    • getFile

      public java.io.File getFile()
      Get file descriptor for audio clip
      Returns:
      File audio clip file