Skip to main content

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

Events Reference

create(url, callback)

Version added: 0.84

Creates an audio file from local path, extension local path or a remote Url.

ParameterTypeDescription
urlstringThe 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
callbackfunctionA 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.

ParameterTypeDescription
idstringThe ID of the audio file to be played
callbackfunctionA 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.

ParameterTypeDescription
callbackfunctionA 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.

ParameterTypeDescription
idstringThe ID of the audio file
callbackfunctionA 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.

ParameterTypeDescription
callbackfunctionA 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.

ParameterTypeDescription
idstringThe ID of the audio file
callbackfunctionA 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.

ParameterTypeDescription
callbackfunctionA 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.

ParameterTypeDescription
idstringThe ID of the audio file
callbackfunctionA 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.

ParameterTypeDescription
volumeintThe desired volume. The volume range is 0 – 100 where a volume of 0 means mute
callbackfunctionA 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.

ParameterTypeDescription
idstringThe ID of the audio file
volumeintThe desired volume. The volume range is 0 – 100 where a volume of 0 means mute
callbackfunctionA 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"
}