Use extra resource for custom audio files

This commit is contained in:
Vortrex
2021-10-25 12:58:42 -05:00
parent a52cfb40f5
commit 04c0443b37
2 changed files with 17 additions and 10 deletions

View File

@@ -8,13 +8,6 @@
// ===========================================================================
function playStreamingRadio(url, loop, volume, element = false) {
if(url == "") {
if(streamingRadio != null) {
streamingRadio.stop();
}
return true;
}
if(streamingRadio != null) {
streamingRadio.stop();
}
@@ -42,4 +35,15 @@ function setStreamingRadioVolume(volume) {
}
}
// ===========================================================================
function playAudioFile(audioName, loop, volume) {
let resource = findResourceByName("connectedrp-extra");
if(resource == null) {
return false;
}
resource.exports.playCustomAudio(audioName, volume/100);
}
// ===========================================================================