Vurv78 / WebAudio

A safe, efficient and powerful replacement for Streamcore that adds playing & manipulating URL streams through IGmodAudioChannel/BASS
https://steamcommunity.com/sharedfiles/filedetails/?id=2466875474
MIT License
18 stars 3 forks source link

Volume and Pause not Working #50

Closed oneandonlyjason closed 2 years ago

oneandonlyjason commented 2 years ago

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):

Vurv78 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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)