-
Notifications
You must be signed in to change notification settings - Fork 68
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
New audio! #335
base: main
Are you sure you want to change the base?
New audio! #335
Conversation
mattgodbolt
commented
Dec 22, 2021
•
edited
Loading
edited
- Outputs audio at chip frequency
- Spits it out as buffers to a web audio thread that then (terribly) downsamples it.
- Various queues and stats
- Horrible hacks to try and keep things in sync.
This reverts commit 58642bd. It was not good enough - averaging works better to reduce noise on e.g. depeche mode.
new AudioWorklet( | ||
new URL("./audio-renderer.js", import.meta.url) | ||
) | ||
); | ||
if (audioFilterFreq !== 0) { | ||
this.soundChip.filterNode = this.audioContext.createBiquadFilter(); | ||
this.soundChip.filterNode.type = "lowpass"; | ||
this.soundChip.filterNode.frequency.value = audioFilterFreq; | ||
this.soundChip.filterNode.Q.value = audioFilterQ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a cleaner separation of web API I/O vs pure emulation code,filterNode
doesn't need to be instanced as a property of soundChip
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I'm only noticing this due to my weird use case running JSbeeb in a worker)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I think I put it there purely to "hang on to it" as I think in some cases if it gets GC'd maybe it stops working?
Webpack's lack of decent support still gives me pause, but...I brought this up to date at least. |