Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
audio-vs1053b
Advanced tools
#Audio Module
##Installation
npm install audio-vs1053b
##Example
var tessel = require('tessel');
var fs = require('fs');
var audio = require('audio-vs1053b').use(tessel.port('a'), function(err) {
// Start recording data for a second into a file
audio.setInput('microphone', function(err) {
// Start the recording
audio.startRecording(function(err) {
// In one second
setTimeout(function() {
// Stop recording
audio.stopRecording(function(err, oggBuffer) {
// Write the buffer to a file
fs.writeFile("micdata", oggBuffer, function(err) {
console.log("Wrote to a file");
});
})
}, 1000);
});
});
});
var tessel = require('tessel');
var fs = require('fs');
var audio = require('audio-vs1053b').use(tessel.port('a'), function(err) {
// Start recording data for a second into a file
audio.setInput('microphone', function(err) {
// Open a stream to a file
var file = fs.createWriteStream('lineInData.ogg');
// Create a readable stream of incoming data
var soundData = audio.createReadStream();
// Pipe data to the file
soundData.pipe(file);
// Enable sound input
audio.startRecording();
});
});
var tessel = require('tessel');
var fs = require('fs');
var audio = require('audio-vs1053b').use(tessel.port('a'), function(err) {
// Start recording data for a second into a file
audio.setOutput('headphone', function(err) {
// Open a file
var audioFile = fs.readFileSync('Oops... I did it again.mp3');
// Play the file
audio.play(audioFile);
});
});
##API
###Commands
// Set the output volume. Level is a Number from 0.0 to 1.0
audio.setVolume( level, function(err) {...} );
// Set the input to either 'lineIn' or 'microphone'. Defaults to 'lineIn'.
audio.setInput( input, function(err) {...} );
// Set the output to either 'lineOut' or 'headPhones'. Defaults to 'lineOut'.
audio.setOutput(output, function(err) {...} );
// Start recording sound from the input.
audio.startRecording( function(err) {...} );
// Stop recording sound and return an OGG-encoded buffer
audio.stopRecording( function(err, oggBuff) {...} );
// Play a buffer
audio.play( audioBuff, function(err) {...} );
// Pause the buffer
audio.pause( function(err) {...} );
// Stop playing and flush the buffer
audio.stop( function(err) {...} );
// Returns a stream that a buffer can be piped into to play audio
audio.createWriteableStream();
// Returns a readable stream of mic data
audio.createReadableStream()
###Events
// The audio module is ready to use
audio.on( 'ready', function() {...} );
// The audio module had an error on connection
audio.on( 'error', function(err) {...} );
// Volume was set
audio.on( 'volume', function(volume) {...} );
// The input mode was set
audio.on('input', function(input) {...} );
// The output mode was set
audio.on('output', function(output) {...} );
// Started recording from the input
audio.on('startRecording', function() {...} );
// Stopped recording on the input
audio.on('stopRecording', function() {...} );
// A buffer is beginning to be played
audio.on('play', function() {...} );
// The buffer was paused
audio.on('pause', function() {...} );
// The buffer was stopped
audio.on('stop', function() {...} );
FAQs
Library to run the Tessel Audio Module. Plays and records sound.
The npm package audio-vs1053b receives a total of 0 weekly downloads. As such, audio-vs1053b popularity was classified as not popular.
We found that audio-vs1053b demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.