captbaritone / webamp

Winamp 2 reimplemented for the browser
https://webamp.org
MIT License
10.1k stars 671 forks source link

khz is incorrect for 44khz files (on some systems) #385

Open captbaritone opened 7 years ago

captbaritone commented 7 years ago

https://twitter.com/Manawyrm/status/910488362984837122

This value comes from the AudioBuffer.sampleRate API so I doubt there is much we can do about it, but we should at least try to reproduce.

captbaritone commented 7 years ago

In these instances, the audio playback also seems broken.

Manawyrm commented 7 years ago

Hm, I just noticed something: .sampleRate is not 19 kHz, like the player shows, but rather 192 kHz! I do have a high-quality soundcard in my PC. Maybe this is what is causing the playback to break?

https://screenshot.tbspace.de/dxktougnijs.png

captbaritone commented 7 years ago

Interesting. Could you send me the exact audio file that's causing this? Perhaps via https://send.firefox.com/ and a Twitter DM?

Manawyrm commented 7 years ago

Every audiofile does this, even the Llama one :)

Manawyrm commented 7 years ago

I think if you write "default-sample-rate = 192000" into the ~/.pulse/daemon.conf, this should force pulseaudio into this sample rate, even if the soundcard doesn't support it.

captbaritone commented 7 years ago

Something is funny though. If you are seeing 192000 in your console, it should come through correctly (at least in the UI). Let me first check that the UI code works for larger sampleRates.

https://github.com/captbaritone/winamp2-js/blob/1ead097fcdb4571e11b36ca61164760aba62b9a3/js/mediaMiddleware.js#L51

captbaritone commented 7 years ago

Oh. The little box just isn't big enough 😀 I guess there's not much that can be done on the UI front. Sounds like this is likely a Chrome bug. Does this happen if you just create a simple <audio src=""/> tag?

Manawyrm commented 7 years ago

https://screenshot.tbspace.de/sanduecyijw.png

A simple audio-Tag works, but I just noticed, that chiptune2.js does infact not work anymore, also. This really seems like a new chrome bug, because I used the chiptune2.js lib in the past.