Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audio API alt.Audio.getOutputs() doesn't work #177

Open
eiksch opened this issue Jul 17, 2022 · 0 comments
Open

Audio API alt.Audio.getOutputs() doesn't work #177

eiksch opened this issue Jul 17, 2022 · 0 comments
Labels
type: bug Something isn't working

Comments

@eiksch
Copy link

eiksch commented Jul 17, 2022

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

  1. initialize sound let sound = new alt.Audio("https://dl.statev.de/test.ogg", 1, "hud", false);
  2. 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
  1. 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

@eiksch eiksch added the type: bug Something isn't working label Jul 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant