GithubHelp home page GithubHelp logo

node-microphone's People

Contributors

flowr-es avatar juliendargelos avatar rhysmorgan134 avatar zanawar 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

Watchers

 avatar  avatar  avatar  avatar

node-microphone's Issues

Continouse audio input ?

I'm trying to get a continuous stream of input from my microphone using the node-microphone. However, after i get my first buffer, it stops reading. Does the info event pick up all the audio, or this buffer for something else?

const stream = require('stream');
const fs = require('fs');
const mkfifo = require('mkfifo').mkfifo;
const writestream = fs.createWriteStream('audiopipe');

let Mic = require('node-microphone');
let mic = new Mic();
let micStream = mic.startRecording();
micStream.pipe( writestream );
setTimeout(() => {
    console.log('stopped recording');
    mic.stopRecording();
}, 5000);
mic.on('info', (info) => {
	console.log(info);
});
mic.on('error', (error) => {
	console.log(error);
});

image

Live streaming to a client

Is it possible to provide a live streaming to the user through this?
I've tried the following code

var Mic = require('node-microphone');
var mic = new Mic();

app.get('/testmic',function(req,res) {
	var micStream = mic.startRecording();
	micStream.pipe(res);
});

when I directly pointed to this address (localhost:4000/testmic) the stream is getting downloaded as some file.
But I want it such that when I assign this url to a audio src attribute in HTML5 audio element, I should be able to listen to the stream.

Is it possible? If yes, where have I done the mistake?

Windows 10 SoX issue

I am trying to run the node-microphone example on my Windows 10 machine.
It is crashing with the following error

SoX is installed and added to the Environment Path

`events.js:160
throw er; // Unhandled 'error' event
^

Error: spawn sox ENOENT
at exports._errnoException (util.js:1026:11)
at Process.__dirname.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Timeout.Module.runMain as _onTimeout
at tryOnTimeout (timers.js:232:11)
at Timer.listOnTimeout (timers.js:202:5)
Press any key to continue...`

How can I fix this ?

Raspberry PI - issue when requireing node-microphone

On Raspberry PI I am having the following issue:

/node_modules/node-microphone/index.js:6
class Microphone {
^^^^^
SyntaxError: Unexpected reserved word
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/home/pi/git/myapp/app_client_socketio.js:99:11) //this is where I load
//var Mic = require('node-microphone');
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)

Do you know what I am doing wrong ?

Constructor options documentation is hardly readable

This is how the constructor options documentation appears:

Create a new Class of the microphone module. You can give an options Object with the class. options - JSON containing sound options.Following are valid options: endian: big OR little, default: little bitwidth: 8 OR 16 OR 24 OR anything valid supported by arecord OR sox, default: 16 encoding: signed - integer OR unsinged- integer(none of the other encoding formats are supported), default:signed - integer rate: 8000 OR 16000 OR 44100 OR anything valid supported by arecord OR sox, default: 16000 channels: 1 OR 2 OR anything valid supported by arecord OR sox, default: 1(mono) device: hw: 0, 0 OR plughw: 1, 0 OR anything valid supported by arecord. For sox it is taken as waveaudio drive.

node index.js ?

How can I test my MIC ? nothing happens with
pi@Rose:~/node/node_modules/node-microphone $ node index.js

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.