Rinnegatamante / lpp-vita

Lua Player Plus for PSVITA. Documentation on: http://rinnegatamante.github.io/lpp-vita/
GNU General Public License v3.0
179 stars 27 forks source link

Static Audio #68

Open BlackSheepBoy69 opened 1 year ago

BlackSheepBoy69 commented 1 year ago

In RetroFlow/HexFlow/etc there's an issue with the "click" sound. Use the analog stick to move while spamming the "R" button is an easy way to get it: the audio overlaps and causes a super loud glitch sound. You might say "well that's easy, don't hold analog stick and spam R button" but once you have enough apps installed, it happens very often with just using analog stick. I've tried many things to fix it like checking whether the audio is playing before playing the sound again, setting a timer of minimum time before next click is allowed... these solutions ALMOST worked but still sometimes (admittedly less often though) there was the super loud glitch sound. What worked was making the click audio into a .mp4 file and using "Video.jumpToTime(0)" and "Video.resume()" and it will act exactly how I want it: no more super loud glitch sound from overlapping .mp3 audio.

...but there's just 1 issue. Having it as a video causes lag in the app

Can you please add this command? Sound.jumpToTime(click, 0)

It's just an example. In this case, it's assuming the audio file has been loaded to variable "click" by using this feature that already exists: Sound.open("app0:/DATA/click2.wav")

I just need to be able to jump to a time in the audio so 2 sound.play() of the same audio don't glitch out please.

Thank you Rinne for all your good code!!!!! And thanks if you can help figure this out.

Rinnegatamante commented 1 year ago

Audio system is not same of video one. "jumpToTime" is not something easily doable. Did you try to just add a few seconds of mute audio in the sound file at the end?

BlackSheepBoy69 commented 1 year ago

Just adding muted audio, or adding muted audio and using the "if sound.is_playing then sound.stop" (pseudocode)? I'll try both when I get a sec