Coder Social home page Coder Social logo

Example for cleanup about webaudio-examples HOT 3 CLOSED

mdn avatar mdn commented on September 17, 2024
Example for cleanup

from webaudio-examples.

Comments (3)

luckydonald avatar luckydonald commented on September 17, 2024

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

from webaudio-examples.

chrisdavidmills avatar chrisdavidmills commented on September 17, 2024

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

from webaudio-examples.

bsmth avatar bsmth commented on September 17, 2024

I'm closing this due to inactivity. If you'd like to come back to this, feel free to reply and we can reopen to consider the improvements. Thank you! :)

from webaudio-examples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.