You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you want to clear every output from an alt.Audio source, you have to get every output and remove it with alt.Audio.removeOutput().
Because alt.Audio.getOutputs() does not work, you cannot get the previously set outputs.
WORKAROUND: save them in an array or map by yourself and then clear with alt.Audio.removeOutput()
Reproduction steps
initialize sound let sound = new alt.Audio("https://dl.statev.de/test.ogg", 1, "hud", false);
add output
let targetName = "FILL_IN_NAME";
let p = alt.Player.all.find((p) => p.name === targetName);
if(!p){
return;
}
sound.addOutput(p.scriptID); //same behavior if I set p.scriptID or p, function accepts both apparantly
remove every output set
let outputs = sound.getOutputs();
for(let o of outputs){
sound.removeOutput(o.scriptID); //again, both, o and o.scriptID fail
}
[18:18:52][Error] sound.removeOutput(o);
[18:18:52][Error] Error: Argument 1 must be a Entity
Expected behaviour
that it returns every output
Additional context
Operating system
Windows 11
Version
alt:V build 11.4, branch release
Scope
client
The text was updated successfully, but these errors were encountered:
Description of the problem
When you want to clear every output from an alt.Audio source, you have to get every output and remove it with alt.Audio.removeOutput().
Because alt.Audio.getOutputs() does not work, you cannot get the previously set outputs.
WORKAROUND: save them in an array or map by yourself and then clear with alt.Audio.removeOutput()
Reproduction steps
let sound = new alt.Audio("https://dl.statev.de/test.ogg", 1, "hud", false);
Expected behaviour
that it returns every output
Additional context
Operating system
Windows 11
Version
alt:V build 11.4, branch release
Scope
client
The text was updated successfully, but these errors were encountered: