How to use audio sources.
OpenAudioMc is a web-first platform, meaning that everything you give it as input has to be accessible over the internet. In this case, that means that your media sources need to come from a publicly available web-page or another supported platform.
This usually comes in the form of URL's you enter within your other audio related commands or API queries.
We support a handful of methods to get your media to the client. These include:
OpenAudioMc supports random media playback, which means that you can give it a list of media sources and pick one at random to play. These lists are treated as playlists when the media is set to loop (as is the case in regions, speakers, and when you manually set the flag). To do this, simply provide a JSON array in place of a single media source. For example:
["https://soundcloud.com/creide13/the-last-king-of-hyrule","https://soundcloud.com/creide13/a-kings-request-cutscene"]
Media playback behaviour can be configured through Media Options. These can be used in some commands in the form of a JSON string, or as a MediaOptions
object through the API.
It supports the following properties
fadeTime
(Integer): Time for the sound to fade in (in MS)id
(String): A manual ID/reference to the newly started media. Can be used to stop/edit this media later onloop
Boolean: A boolean flag that indicates if this media should loop when it finished (true/false), default is false.pickUp
Boolean: A boolean flag that indicates if the client should attempt to synchronize with other listeners. Default is false.expirationTimeout
Integer: Media is normally only started for players who have their client open at the time the command is sent. With this timeout, you can make OpenAudioMc wait a given amount of time (in seconds), after which the media will still play for a client even if they connected a bit later.volume
Integer: The volume (from 0 to 100%) at which the media should be played. This is still relative to the users own volume slider. (Default value is 100)
{fadeTime:1500,id:"spawn",loop:true,pickup:true,expirationTimeout:3600000,volume:50}
Note that the JSON may never include spaces or line breaks.