overwolf.media.audio API
A set of functions for playback of audio files. Currently supports MP3 and WAV files.
obsolete
The overwolf.media.audio API is deprecated. Use the html5 audio tag instead.
Methods Reference
- overwolf.media.audio.create()
- overwolf.media.audio.play()
- overwolf.media.audio.stop()
- overwolf.media.audio.stopById()
- overwolf.media.audio.pause()
- overwolf.media.audio.pauseById()
- overwolf.media.audio.resume()
- overwolf.media.audio.resumeById()
- overwolf.media.audio.setVolume()
- overwolf.media.audio.setVolumeById()
Events Reference
create(url, callback)
Version added: 0.84
Creates an audio file from local path, extension local path or a remote Url.
Parameter | Type | Description |
---|---|---|
url | string | The path of a local audio file, a url to a remote one or an extension url overwolf-extension://app-id/file . Notice that if the url doesn’t contain a file extension, mp3 will be assumed as the extension |
callback | function | A callback function which will be called with the ID of the created audio file |
Callback argument: Success
A callback function which will be called with the status of the request and the ID of the created audio file:
{
"status": "success",
"id": "1086e4469a5fb242e81223ce627e3747"
}
play(id, callback)
Version added: 0.84
Plays the audio file matching the supplied ID.
Parameter | Type | Description |
---|---|---|
id | string | The ID of the audio file to be played |
callback | function | A callback function which will be called with the status of the play request |
Callback argument: Success
{
"status": "success"
}
stop(callback)
Version added: 0.84
Stops the playback.
Parameter | Type | Description |
---|---|---|
callback | function | A callback function which will be called with the status of the stop request |
Callback argument: Success
{
"status": "success"
}
stopById(id, callback)
Version added: 0.84
Stops the playback.
Parameter | Type | Description |
---|---|---|
id | string | The ID of the audio file |
callback | function | A callback function which will be called with the status of the stop request |
Callback argument: Success
{
"status": "success"
}
pause(callback)
Version added: 0.84
Pauses the playback.
Parameter | Type | Description |
---|---|---|
callback | function | A callback function which will be called with the status of the pause request |
Callback argument: Success
{
"status": "success"
}
pauseById(id, callback)
Version added: 0.84
Pauses the playback.
Parameter | Type | Description |
---|---|---|
id | string | The ID of the audio file |
callback | function | A callback function which will be called with the status of the pause request |
Callback argument: Success
{
"status": "success"
}
resume(callback)
Version added: 0.84
Resumes the playback.
Parameter | Type | Description |
---|---|---|
callback | function | A callback function which will be called with the status of the resume request |
Callback argument: Success
{
"status": "success"
}
resumeById(id, callback)
Version added: 0.84
Resumes the playback.
Parameter | Type | Description |
---|---|---|
id | string | The ID of the audio file |
callback | function | A callback function which will be called with the status of the resume request |
Callback argument: Success
{
"status": "success"
}
setVolume(volume, callback)
Version added: 0.84
Sets the playback volume.
Parameter | Type | Description |
---|---|---|
volume | int | The desired volume. The volume range is 0 – 100 where a volume of 0 means mute |
callback | function | A callback function which will be called with the status of the setVolume request |
Callback argument: Success
{
"status": "success"
}
setVolumeById(id, volume, callback)
Version added: 0.84
Sets the playback volume.
Parameter | Type | Description |
---|---|---|
id | string | The ID of the audio file |
volume | int | The desired volume. The volume range is 0 – 100 where a volume of 0 means mute |
callback | function | A callback function which will be called with the status of the setVolume request |
Callback argument: Success
{
"status": "success"
}
onPlayStateChanged
Version added: 0.84
Fired when the state of the playback is changed.
Event Data Example: Success
{
"id": "1086e4469a5fb242e81223ce627e3747",
"playback_state": "paused"
}