Giter VIP home page Giter VIP logo

volume-meter's People

Contributors

cwilso avatar martianyi avatar theodeus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

volume-meter's Issues

Input stream closes on Firefox.

Hi I'm trying to use this example and the input stream only lasts for 5 seconds on firefox (same with the input effects, but not audiorecorder?). Is this an issue with the examples or web audio api?

Thanks for taking a look at this, I'm more of an artist than a coder, the work with web audio is really exciting!

volume meter on system audio?

I like your project thank you for your great project.
I will volume meter just on system audio not on live input (mic), how to?
What do I replace and to come be? Would you like to show me the code, please?

http://webaudiodemos.appspot.com/volume-meter/ doesn't work

I get this error when trying to load the page in chromium:

getUserMedia() no longer works on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.

Typescript typings

Here is TypeScript typings if someone is using this module in a TypeScript environment:

export = createAudioMeter;

declare type ScriptProcessorNodeMod = ScriptProcessorNode & {
  clipping = boolean;
  lastClip = number;
  volume = number;
  clipLevel = number;
  averaging = number;
  clipLag = number;

  checkClipping: () => boolean;
  shutdown: () => void;
};

declare function createAudioMeter(
  audioContext: AudioContext,
  clipLevel: number,
  averaging: number,
  clipLag: number,
): ScriptProcessorNodeMod;

Relaunch of createAudioMeter

Hello, thanks for useful example. I have integrated it in my React app, with calling of meter.shutdown() and window.cancelAnimationFrame(rafID) when component is unmounted. It works fine, however I can't relaunch this gotStream(stream) function when the stream is changed (user choosed another microphone). Maybe you have any suggestions about how it can be relaunched with updated stream?

Using with chrome ?

I was wondering how one would have to change this to get it working with chrome.
For me it works well with Firefox, but on chrome and edge it only asks for mediaStream access but the meter does not animate after that....

Doesn't work in a webview (Cordova)

Hi,

this small library would be perfect for me, but It doesn't work with Cordova.
Buffers are always to 0.

It's a bit weird because It work well in Android Chrome but not when in a Cordova App that use a Android Chrome webview..maybe It's related to this : https://bugs.chromium.org/p/chromium/issues/detail?id=419446

This isn't a bug from your library but If you have any idea why and how I could solve this, I would praise you like a god. If not, you can close this issue right now and thanks for that lib!

Stream generation failed

Hi! About a month ago this was working, but now shows "Stream generation failed" error in Chrome (I checked several PCs).

Function Deprecated

Just FYI. Many of the functions used here are or will be deprecated soon including navigator.getUserMedia and createScriptProcessor.

High CPU usage

I saw what you wrote and thought the CPU issues would be caused by createScriptProcessor

Having between 30 to 45% CPU usage on this volume meter, I spend some time to look for ways to improve this.

In conclusion, it has nothing to do with it, this is cause by calling recursively requestAnimationFrame

This example with easily push your CPU usage to 30%:

var canvas = document.createElement('canvas');
canvas.width = 100;
canvas.height = 20;
var canvasContext = canvas.getContext('2d');
document.body.appendChild(canvas)
var rafId;
function drawLoop(time) {
  canvasContext.clearRect(0, 0, 100, 20);
  canvasContext.fillRect(0, 0, Math.random() * 100 * 1.4, 20);
  rafID = window.requestAnimationFrame(drawLoop);
}

This repo is more about the web audio API usage, but do you have any suggestion to improve this?

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.