-
Notifications
You must be signed in to change notification settings - Fork 4
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
Update README.md with better example #23
base: develop
Are you sure you want to change the base?
Conversation
@hollingsworthd
|
Yes this produces less clicks/pop. I don't know a good way around this. Maybe I can put the web sample.length at 44100 and bufLen at 8500 and just leave a comment that these should maybe be adjusted per dev judgment. I would also comment that depending on the sound card on desktop there might be no options to play sound at non-standard sample rates (44.1k, 46.0k, etc) I did try to modify the C and JS code to get the push() method to return the number of samples written thinking that may allow more options for implementors to handle exhaust/full states. But after several hours of work I failed. I might try again one day. |
Regardless I think the code looks cleaner than the current example code, IMO, but it will produce different results. The current conditional of t > 0 bothers me a bit because it's just to fill the buffer more. |
It may be appropriate to also just revert to your original example code. Sorry btw for spamming you 3x with comments. :) And thank you very much for open sourcing this project. It's amazing and I hope more people find it. Across the internet many people ask how to synthesize audio and on all platforms for Flutter. |
@hollingsworthd |
I think I figured it out. If you use a stopwatch to measure the time between calls to push audio samples (to get the perfect buffer size) then it cuts out most pops. The one second periodic timer is only approximate but when used together with a stopwatch it's effective. I'll need to create a clean example of this. |
This has less glitches/pops in audio playback on web and desktop