What are media 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.
Supported platforms
We support a handful of methods to get your media to the client. These include:
- Direct Uploads
- Navigate to https://account.openaudiomc.net/my-files
- Upload your file, and give it a name like mycoolsong
- Use it in-game like /oa play @a files:mycoolsong.mp3
- SoundCloud
- SoundCloud media must be public (so no private uploads/accounts)
- Some artists may not allow their content to be used on third party sites, so playback will not work in these cases
- Although supported, this isn't advised for production use.
- Your own Web Server
- Your Web Server must have a valid domain with an SSL certificate
- Your Web Server must support partial content, most big vendors support this natively when serving directly from the file system
- Compatible file-types depend on the browsers your players use. We recommend sticking with .mp3 or .m3u for live sources
- Try to keep individual file-sizes below 25Mb to ensure reliability
- YouTube links (legacy/unsupported) (handled by a third party)
- YouTube links may not work the first time you use them, as they have to be pre-processed before playback is available. This can take a while depending on the content length. Please Try again later if it doesn't work initially.
- Content may not be longer than 60 minutes, but we recommend aiming for 15 minutes max.
- Although supported, this isn't advised for production use.
Random media and playlists
Playlists have moved and are now their own dedicated feature. Please visit the Playlists page for more information.
Media Options
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)muteRegions
Boolean: This will mute all regions for the player while this sound is playing. (Default value is false)muteSpeakers
Boolean: This will mute all speakers for the player while this sound is playing. (Default value is false)
A full media flags object might look a little like this
{fadeTime:1500,id:"spawn",loop:true,pickup:true,expirationTimeout:3600000,volume:50}
Note that the JSON may never include spaces or line breaks.
An example of a file for everyone in a region, that would overwrite regions and speakers could look like this
/oa play @a[region=showarea] https://soundcloud.com/lobsta-b/not-so-bad {muteRegions:true,muteSpeakers:true,id:"my-show"}