Class AndroidAudioService

  • All Implemented Interfaces:
    AudioService

    public class AndroidAudioService
    extends java.lang.Object
    implements AudioService
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<Audio> loadMusic​(java.net.URL url)
      Load a (long) music object (typically ".mp3") from a given URL.
      java.util.Optional<Audio> loadSound​(java.net.URL url)
      Load a (short) sound object (typically ".wav") from a given URL.
      • Methods inherited from class java.lang.Object

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

      • AndroidAudioService

        public AndroidAudioService()
    • Method Detail

      • loadSound

        public java.util.Optional<Audio> loadSound​(java.net.URL url)
        Description copied from interface: AudioService
        Load a (short) sound object (typically ".wav") from a given URL. This call will block until the audio is fully loaded. You may wish to load the audio on a non-JavaFX thread.
        Specified by:
        loadSound in interface AudioService
        Parameters:
        url - where the sound file is
        Returns:
        optional containing the sound file or empty if any errors occurred during loading
      • loadMusic

        public java.util.Optional<Audio> loadMusic​(java.net.URL url)
        Description copied from interface: AudioService
        Load a (long) music object (typically ".mp3") from a given URL. This call will block until the audio is fully loaded. You may wish to load the audio on a non-JavaFX thread.
        Specified by:
        loadMusic in interface AudioService
        Parameters:
        url - where the music file is
        Returns:
        optional containing the music file or empty if any errors occurred during loading