NssAudio
This component provide a simple audio player to play sound fx.
How to use
ES6 module import
For NssUiApi usage, please see the README.md of the nss_libs/ui folder.
Alternative example of direct ES6 module import:
import {NssAudio} from "nui://nss_libs/ui/NssAudio/NssAudio.js";Simple sound fx player
import {NssAudio} from "nui://nss_libs/ui/NssAudio/NssAudio.js";
/**
* @type {NssAudio}
*/
const audio_player = new NssAudio('nui://RESOURCE_NAME/PATH/TO/YOUR/SOUNDS/');
audio_player.setVolume(0.5);
audio_player.playAudio('YOUR_SOUND_FILE.mp3'); // Returns promise which is resolved if sound was endedIntegrated SFX commands
Last updated
Was this helpful?