How to use the microphone-stream function in microphone-stream

To help you get started, we’ve selected a few microphone-stream examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Johni0702 / mumble-web / app / voice.js View on Github external
getUserMedia({ audio: true }, (err, userMedia) => {
    if (err) {
      onUserMediaError(err)
    } else {
      theUserMedia = userMedia
      var micStream = new MicrophoneStream(userMedia, { objectMode: true, bufferSize: 1024 })
      micStream.on('data', data => {
        onData(Buffer.from(data.getChannelData(0).buffer))
      })
    }
  })
}
github kneekey23 / ByteConf / ml-javascript / src / components / Transcribe.js View on Github external
window.navigator.mediaDevices.getUserMedia({ video: false, audio: true }).then((stream) => {
        const startMic = new mic();

        startMic.setStream(stream);

        startMic.on('data', (chunk) => {
          var raw = mic.toRaw(chunk);
          if (raw == null) {
            return;
          }

        buffer = buffer.concat(...raw)
        this.setState({audioBuffer: buffer})
      });

      this.setState({recording: true})
      this.setState({micStream: startMic})
    })

microphone-stream

A stream of raw audio data from the microphone for use in browsers with getUserMedia

MIT
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis

Popular microphone-stream functions