|  Developer
Updated on November 18, 2021

speaker.play()

  • Starts a new asynchronous playback task. Returns a command’s identifier.
Edit
Table Field Type Required Description
path string + Path to an audio file (.wav) in plugin path format.
handler string Path to a script file of the plugin which should be executed when any event of playing sound would be generated (in HUB:my_plugin/http_receive.lua format)
time int Time of playing in seconds. If not defined then the file will be played once from beginning to the end. The sound will be played infinitely if -1 value passed.
volume (*) int The volume of playing. Possible range: 1-100. Default value: 80.
(*) Not implemented
user_data any Any data which will be passed to receive_script and send_script. Can be of any valid type: string, number, boolean, array, object. If user_data is null, the value will not be set.
Edit
id of the command
Edit
  • Required parameter didn’t define:
  • The file doesn’t exist:
  • Plugin doesn’t have permissions to the file:
  • Wrong format of a parameter:
  • Limit of a parameter is reached:
  • Limit of connections is reached