tessel / audio-vs1053b Goto Github PK
View Code? Open in Web Editor NEW[UNMAINTAINED] JavaScript module for the VS1053b audio driver.
License: Other
[UNMAINTAINED] JavaScript module for the VS1053b audio driver.
License: Other
I'm setting the volume of the audio output, where I have earplugs plugged-in.
I'm setting it to 0.1 as number, but the thing still keeps playing sound at full volume.
I'm playing the sound in the callback handler.
audio.setVolume(.1, function(err){
if (err) {
return console.log(err);
}
var sound = fs.readFileSync('mySound.mp3');
audio.play(sound, function(err) {
if (err) {
console.log(err);
}
}
});
The problem is that microSD needs a lock on the SPI Bus while it's sending/receiving data but Audio needs the SPI bus to gather recording data or write data to the audio chip. We need a way for the Audio module to lock the SPI bus from the C shim or just block the whole time it's recording.
We need to investigate what about IR and Ambient is holding the MISO line up.
My hunch is that our microphone doesn't produce a signal with high enough peaks. Increasing the gain on the AGC only increases noise with minimal gains to the actual signal
I tried to read a mp3 file (40Kb) and play it back, but the playback stopped before end of the file. I was using the code below:
var tessel = require('tessel');
var audio = require('audio-vs1053b').use(tessel.port['B']);
audio.on('ready', function () {
audio.setVolume(1, 1, testFilePlayback);
});
function testFilePlayback() {
var song = fs.readFileSync('test.mp3');
audio.play(song);
}
Possible workaround
Duplicate the line that does audio.play(song);
I.e. this worked
function testFilePlayback() {
var song = fs.readFileSync('test.mp3');
audio.play(song);
audio.play(song); // Intentional duplication to play song to the end.
}
Originally reported on the forums.
If you control+c out of a script while the audio is playing, then you can't deploy another script until resetting the Tessel.
It's worth noting that you can run tessel list
and get the id of the Tessel back. You just can't run a new script.
See relevant forum post.
I don't have a repro test case but sometimes I get the following error:
[T]: src/colony/lua/colony-init.lua:14: attempt to call global 'getmetatable' (a nil value)
stack traceback:
[T]: src/colony/lua/colony-init.lua:14: in function 'js_proto_get'
[T]: src/colony/lua/colony-init.lua:14: in function <[T]: src/colony/lua/colony-init.lua:400>
[T]: src/colony/lua/colony-node.lua:14: in function 'on'
[T]:src/colony/modules/_stream_readable.js:14: in function 'pipe'
/app/test.js:136: in function 'testRecordStream'
/app/test.js:174: in function 'callback'
/app/index.js:337: in function 'func'
[T]: src/colony/lua/colony-js.lua:14: in function 'callback'
/app/index.js:291: in function 'callback'
builtin/tessel.js:993: in function 'f'
[T]: src/colony/lua/colony-node.lua:14: in function '?'
[T]: src/colony/lua/colony-node.lua:14: in function 'emit'
[T]: src/colony/lua/colony-node.lua:14: in function <[T]: src/colony/lua/colony-node.lua:43>
Add code of conduct badge, a la tessel/project#190
Docs communicate that volume is 0 to 1 for setting volume. Code and examples refer to smaller values are higher volume with 20 being a good starting point.
In addition the setVolume
method divides any value by .5
. (Doubling the input).
What is the exact range expectation?
It would be great to introduce a breaking change that makes this consistent with the docs and much more intuitive to use.
I'm happy to fix / patch but wanted to get clarity on goal / direction / implementation.
This used to work fine, what happened?
User feedback: "The Audio In with iPhone headphones did not work even after yelling. Audio Out works and it is fine when I talk directly into the Tessel."
After calling use
, the initialization functionality never completes. The application hangs.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.