Package com.xebisco.yield.manager
Interface AudioManager
public interface AudioManager
The
AudioManager interface should be implemented by the specific platform running the application, it contains function for manipulation audio files.-
Method Summary
Modifier and TypeMethodDescriptiondoublegetLength(AudioPlayer audioPlayer) The function "getLength" takes an AudioPlayer object as input and returns its length as a double.doublegetPosition(AudioPlayer audioPlayer) The function returns the current position of an audio player.booleanisPlaying(AudioPlayer audioPlayer) The function checks if an audio player is currently playing.loadAudio(AudioPlayer audio, FileIOManager ioManager) This function loads an audio file.voidloop(AudioPlayer audioPlayer) voidpause(AudioPlayer audioPlayer) This function takes an AudioPlayer object as input and pauses it.voidplay(AudioPlayer audioPlayer) The function "play" plays an audio clip from an AudioPlayer object.voidsetGain(AudioPlayer audioPlayer, double gain) The function sets the gain of an audio player.voidsetPan(AudioPlayer audioPlayer, double pan) The setPan function sets the stereo panning of an audio player.voidsetPosition(AudioPlayer audioPlayer, double position) The function sets the position of an audio player.voidunloadAudio(AudioPlayer audio, FileIOManager ioManager) The function unloads an audio clip from an audio player.
-
Method Details
-
loadAudio
This function loads an audio file.- Parameters:
audio- The "audio" parameter in the "loadAudio" method is an object of the "AudioPlayer" class. This object contains an audio file that needs to be loaded into the program. The "loadAudio" method is responsible for loading the audio file into the program and returning its clip reference.ioManager- The ioManager used to load the audio file.- Returns:
- The audio clip reference.
-
unloadAudio
The function unloads an audio clip from an audio player.- Parameters:
audio- The "audio" parameter is an object of type "AudioPlayer" that contains an audio file that has been loaded into memory. The "unloadAudio" function is used to free up the memory used by the audio file.ioManager- The ioManager used to load the audio file.
-
play
The function "play" plays an audio clip from an AudioPlayer object.- Parameters:
audioPlayer- The parameter "audioPlayer" is an object of the class "AudioPlayer". It is being passed as an argument to the function "play". The function will play the audio clip related to this AudioPlayer object.
-
loop
-
pause
This function takes an AudioPlayer object as input and pauses it.- Parameters:
audioPlayer- The audio player to be paused.
-
getLength
The function "getLength" takes an AudioPlayer object as input and returns its length as a double.- Parameters:
audioPlayer- The audio player.- Returns:
- A double value representing the length of the audio file being hold by the AudioPlayer object passed as a parameter.
-
getPosition
The function returns the current position of an audio player.- Parameters:
audioPlayer- The audio player.- Returns:
- a double value, which is the current position of the audio player in seconds.
-
setPosition
The function sets the position of an audio player.- Parameters:
audioPlayer- The audio player.position- The position parameter is a double value that represents the desired position in the audio file being played by the AudioPlayer. It is measured in seconds from the beginning of the audio file. By setting the position parameter, you can move the playback position of the audio file to a specific point in time.
-
setGain
The function sets the gain of an audio player.- Parameters:
audioPlayer- The audioPlayer parameter is an object of the AudioPlayer class. It represents the audio player that you want to set the gain for.gain- The gain parameter in the setGain() function is a double value that represents the amount of amplification to be applied to the audio signal.
-
setPan
The setPan function sets the stereo panning of an audio player.- Parameters:
audioPlayer- The audioPlayer parameter is an object of the AudioPlayer class. It represents the audio player that you want to set the pan for.pan- The "pan" parameter in the "setPan" method is a double value that represents the stereo panning of the audio player.
-
isPlaying
The function checks if an audio player is currently playing.- Parameters:
audioPlayer- The audio player.- Returns:
- A boolean value is being returned.
-