Using the "play" command
You can think of the '/oa play' command as one you can use to manually trigger precise playback, for use in effects, shows, or one-off sounds.
Basic usage
The basic syntax for the play command is as follows:
and this command will just play the specified source for the selected players, once. But you can also add optional parameters to modify the playback behavior, such as looping, volume, and fade-in time.
Playback options
The playback options are formatted as a JSON object, and can include the following properties:
| Key | Value | Description | Example |
|---|---|---|---|
| loop | boolean | Sets if this track should loop until stopped | true |
| id | string | Assigns a custom 'id' to this track, letting you update the options or stop this track later | my-song |
| expirationTimeout | int | Keep expirationTimeout/keepTimeout is the amount of seconds that the openaudiomc plugin runtime should keep track of this media for. Used to retroactively play media if a client connected too late | 120 |
| pickUp | boolean | If the media should attempt to pick up where its currently according to the time spent since the initial invocation. | true |
| fadeTime | int | Fade time is the amount of milliseconds it takes to fade in or out. 0 by default, but can be used to create smooth transitions between or to create a fade in effect. | 1500 |
| startAtMillis | int | The starting point of the media, in milliseconds. 0 by default, but can be used to skip intros or start at a certain point. | 8500 |
| volume | int | The volume of the media, 0-100 | 85 |
| muteSpeakers | boolean | If this media will mute current regions while playing. This is used to prevent overlapping media in regions. | true |
| muteRegions | boolean | If this media will mute current speakers while playing. This is used to prevent overlapping media in speakers. | true |
| speed | int | The speed of the media, 100 by default, but can be used to speed up or slow down the media. 100 = normal speed, 200 = double speed, 50 = half speed, etc. | 150 |
Examples
Here are some examples of how to use the '/oa play' command with different options:
- Play a sound once for all players:
Command Example/oa play @a files:welcome.mp3<>Required[]Optional
- Play a sound on loop for a specific player with fade-in:
Command Example/oa play @p files:background-music.mp3 {"loop":true,"fadeTime":2000}<>Required[]Optional
- Play a sound with custom volume and starting point:
Command Example/oa play @a files:effect.mp3 {"volume":70,"startAtMillis":5000}<>Required[]Optional
- Play a sound that will overwrite all regions temporarily:
Command Example/oa play @a files:announcement.mp3 {"muteRegions":true}<>Required[]Optional
Permissions
openaudiomc.commands.play
This permission is required to use the /oa play command
Default access level: op
