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

Player plays a little faster than a true audio source #19

Open
surfskidude opened this issue Mar 20, 2023 · 2 comments
Open

Player plays a little faster than a true audio source #19

surfskidude opened this issue Mar 20, 2023 · 2 comments

Comments

@surfskidude
Copy link

Hey, your player is very cool. I connected it to an audio source, sampling data at 20Khz on an ESP32. The problem is that I get these glitches in the sound as the player is a little ahead of the true audio source. I have verified this by popping up an alert in the browser at startup, thus making it possible to collect some data. The sound is then perfect for a while. Not that you can run this, but I have attached my script designed for the ESP32.
pcmplayer.txt

@samirkumardas
Copy link
Owner

Did you try decreasing flushingTime to smaller e.g. 500?

@surfskidude
Copy link
Author

I tried your suggestion and it did not work. I also tried setting it to zero. However, after analyzing the sound, I noticed that it has a higher pitch in the browser compared to real life. Therefore, I adjusted the PCMPlayer's sampling rate to 3000 less than the actual sampling rate, and now it seems to be working correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants