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

Example for cleanup #26

Open
luckydonald opened this issue Dec 7, 2018 · 2 comments
Open

Example for cleanup #26

luckydonald opened this issue Dec 7, 2018 · 2 comments
Labels
ex: NEW Requests for new examples.

Comments

@luckydonald
Copy link

luckydonald commented Dec 7, 2018

Hey there.
Thanks for all the nice examples.

Could you add an example for an <audio> element, how to unregister all the webaudio nodes, to get back to a normal audio element? Like to be able to register all that stuff again?

@luckydonald
Copy link
Author

I prepared something working in this codepen:
https://codepen.io/luckydonald/pen/NEQLwR?editors=1011

@chrisdavidmills
Copy link
Contributor

Hi there @luckydonald, thanks for the contribution!

This example is getting there, but it could use a bit of updating before we include it in the repo. Here's some feedback:

  1. I think the OO code you've written is fairly elegant, but it is a bit overcomplex for what you are trying to show, and a little confusing. I'd either simplify it, or include some comments to explain what is going on.
  2. Don't use inline event handler attributes, as they are arguably bad practice from a separation of content/behavior standpoint. Use addEventListener() instead
  3. It is not very clear what the buttons do. Maybe make the labels a bit more descriptive, and disable them when it doesn't make sense to press them. Pressing them multiple times in a row seems to cause strange behavior. after a while, pressing stop no longer stops the music playing, which is what I'd expect.
  4. Maybe hide the audio UI (don't include the controls attribute). Then it is a bit clearer that you ought to use the custom buttons to control the example, rather than just using the default audio UI
  5. Analyzer is spelt "analyzer", not "analiser"
  6. For the visualiser, maybe include it as a long bar that goes across the top of the UI, and also fix it so that it clears on every paint. This doesn't seem to work, and the box just fills up with a big red blob in Firefox, and doesn't seem to work at all in Chrome/Safari.

Refer also to our code example guidelines: https://developer.mozilla.org/en-US/docs/MDN/Contribute/Guidelines/Code_guidelines

bsmth pushed a commit to bsmth/webaudio-examples that referenced this issue Oct 5, 2022
@github-actions github-actions bot added the idle Issues and pull requests with no activity for three months. label Dec 28, 2022
@caugner caugner added ex: NEW Requests for new examples. and removed idle Issues and pull requests with no activity for three months. labels Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ex: NEW Requests for new examples.
Projects
None yet
Development

No branches or pull requests

3 participants