Audio library
The Audio library provides functions for playing and handling audio. All features are contained in the “Audio” Lua table found in the “audio.lua” unit.
Usage example:
 
  | 
    -- First, you need to require the “audio.lua” unit require("audio.lua");    
   -- Now you can access the functions of the library. Audio.LIBRARY_FUNCTION(Argument1, Argument2, ...); 
   | 
 
 
Properties and attributes
This attribute contains the Audio Player object used for playing audio to the user's default audio device
Remarks:
 
  - Audio played through this object is not broadcasted to other users. For audio transmission, consider using mesa.audioPlayer instead.
 
 
Functions
 
  | 
    function Audio.asyncLoadAudioStream(source) 
   | 
 
 
Asynchronously creates an AudioStream object using the content of an audio file.
Arguments:
 
  - source - The source of the audio file. You can provide:
 
  
   - A string containing the external URL of the audio. Example: "https://www.domain.com/my/audioFile.mp3"
 
   - A string containing the file address in the plugin VHD . Example: "/audios/kick.wav"
 
   - A Stream object with the audio file content.
 
  
 
Return:
Remarks:
 
  | 
    function Audio.play(source[, volume]) 
   | 
 
 
Plays an audio file using the user's default audio device.
Arguments:
 
  - source - The source of the audio to be played. You can provide:
 
  
   - A string containing the external URL of the audio. Example: "https://www.domain.com/my/audioFile.mp3"
 
   - A string containing the file address in the plugin VHD . Example: "/audios/kick.wav"
 
   - A Stream object with the audio file content.
 
  
  - (Optional) volume - A number representing the volume at which the audio should be played. This number functions as a multiplication factor, where 0.0 means total silence, and 2.0 means double the original audio volume. The default value is 1.0.
 
 
Return:
Remarks:
 
  - This function is a convenient alias and is equivalent to calling "Audio.defaultPlayer:play(address, volume)"
 
  - Refer to the AudioPlayer:play method for a deeper understanding of how this function operates.
 
 
        
Created with the Personal Edition of HelpNDoc: Simplify Your Help Documentation Process with a Help Authoring Tool