Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Machin authored and Sam Machin committed Jan 2, 2018
1 parent 47f931e commit b8682bc
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 174 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules/*
.DS_Store
private.key
config.json
index_home.js
172 changes: 0 additions & 172 deletions index copy.js

This file was deleted.

3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ ngrok.once('connect', function (url) {
ngrokurl = url;
console.log("Ngrok connected as: ", ngrokurl);
});
ngrok.connect(8000);
ngrok.connect({ addr: 8000,
region: 'eu'});

// Watch for BLE Button events
var noble = require('noble');
Expand Down
23 changes: 23 additions & 0 deletions mictest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
var mic = require('mic');
var chunkingStreams = require('chunking-streams');
var SizeChunker = chunkingStreams.SizeChunker;


var micInstance = mic({
rate: '16000',
channels: '1',
debug: true
});


var chunker = new SizeChunker({
chunkSize: 640 // must be a number greater than zero.
});


var micInputStream = micInstance.getAudioStream();
micInputStream.pipe(chunker);
micInstance.start()
chunker.on('data', function(chunk) {
console.log("Chunk size: ", chunk.data.length);
});
3 changes: 2 additions & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ npm install -g node-gyp

echo "defaults.pcm.card 1" >> /etc/asound.conf
echo "defaults.ctl.card 1" >> /etc/asound.conf



0 comments on commit b8682bc

Please sign in to comment.