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

Volume and Pause not Working #50

Closed
oneandonlyjason opened this issue May 15, 2022 · 4 comments
Closed

Volume and Pause not Working #50

oneandonlyjason opened this issue May 15, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@oneandonlyjason
Copy link

oneandonlyjason commented May 15, 2022

Describe the bug
The Pause and Volume Function doesnt work

To Reproduce
Steps to reproduce the behavior:
I used the Following E2 Code:

Audio:play()
Audio:setVolume(300)
Audio:update()
Audio:pause()

Expected behavior
I would think that with this Code the Stream Starts, the Volume gets increased to 300% and it Stops the Stream Again.
But in direct Comparision to a Stream with 100% Volume it is not any Louder and the pause() is ignored also. I would expect that the Stream Stops but it just keeps playing

Desktop (please complete the following information):

  • OS: Windows
  • Gmod Branch: x86-64
@oneandonlyjason oneandonlyjason added the bug Something isn't working label May 15, 2022
@Vurv78
Copy link
Owner

Vurv78 commented May 15, 2022

Use the @strict directive and your chip should throw an error. This code probably doesn't work as you are going over the networking burst limit (it should be 10/s but I don't know if your chip is running more than this example does)

Also xwa:pause() xwa:play() and xwa:update() all send the information to the client so you don't need to do xwa:update() and then xwa:pause() right after, you can just do xwa:pause()

@oneandonlyjason
Copy link
Author

oneandonlyjason commented May 15, 2022

Yeah this was Just an Example to See if i make anything wrong in my normal Chip

My Normal Chip Starts a Stream when i use a Command.
When i use the Stop Command the Chip Executes:
Music:stop()

Where Music is my WebAudio Object. I can also see that this Part of the Code Executes because everything Visual after that Command Executes correctly
Just the Music does not stop, it just keeps Playing. And Same for the Volume in the End
When i activate the @strict directive it also doesnt throw an Error it just doesnt pause the Music

@oneandonlyjason
Copy link
Author

Ok i figured out what was wrong... And its kinda my Bad because im not used to OOP in E2. I needed a @persist Stream:webaudio so that the Object he would use is the Same Everytime i guess. My Guess is that the Object was not Persist and Global per Default so he didnt find it when he Tried to Stop the Stream

@Vurv78
Copy link
Owner

Vurv78 commented May 15, 2022

Need to make WebAudio properly give an error if you try and use it while it isn't valid then. (At least with @strict on)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants