Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
thijstriemstra committed Oct 12, 2018
1 parent 8459a7a commit 0ccefdf
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 244 deletions.
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -255,6 +255,7 @@ The available options for this plugin are:
| `audioBitRate` | float | `128` | The audio bitrate in kbps (only used in the lamejs plugin). |
| `audioChannels` | float | `2` | Number of audio channels. Using a single channel results in a smaller filesize. |
| `audioWorkerURL` | string | `''` | URL for the audio worker, for example: `/opus-recorder/build/encoderWorker.min.js`. Currently only used for opus-recorder and lamejs plugins. |
| `audioBufferUpdate` | boolean | `false` | Enables the `audioBufferUpdate` event that provides realtime `AudioBuffer` instances from the input audio device. |
| `animationFrameRate` | float | `200` | Frame rate for animated GIF (in frames per second). |
| `animationQuality` | float | `10` | Sets quality of color quantization (conversion of images to the maximum 256 colors allowed by the GIF specification). Lower values (minimum = 1) produce better colors, but slow processing significantly. The default produces good color mapping at reasonable speeds. Values greater than 20 do not yield significant improvements in speed. |

Expand Down Expand Up @@ -309,7 +310,7 @@ player.on('startRecord', function() {
| `enumerateReady` | `enumerateDevices` returned the devices successfully. The list of devices is stored in the `player.record().devices` array. |
| `enumerateError` | An error occured after calling `enumerateDevices`. Check the `player.enumerateErrorCode` property for an description of the error. |
| `audioOutputReady` | Audio output was changed and is now active. |
| `audioBufferUpdate` | Fires continuously during audio-only recording (until recording is stopped or paused). |
| `audioBufferUpdate` | Get realtime `AudioBuffer` instances from microphone. Fires continuously during audio-only recording (until recording is stopped or paused) when the `audioBufferUpdate` option is enabled. |

Media constraints
-----------------
Expand Down
1 change: 1 addition & 0 deletions examples/upload/websocket.html
Expand Up @@ -52,6 +52,7 @@
audio: true,
video: false,
maxLength: 10,
audioBufferUpdate: true,
debug: true
}
}
Expand Down
Expand Up @@ -3,10 +3,8 @@
*/

const http = require('http');
const uuid = require('uuid/v5');
const sockjs = require('sockjs');
const colors = require('colors/safe');
const node_opus = require('node-opus');
const node_static = require('node-static');

// create websocket
Expand All @@ -32,17 +30,7 @@ sockjs_upload.on('connection', function(conn) {
//
index++;

console.log(colors.blue(' received audio buffer [' + colors.cyan(index) + ']...'), data);

// XXX: AudioBuffer to eventual file

/*
var fileName = uuid() + '.ogg';
writeToDisk(data, fileName);
console.log(colors.green('saved file.'));
console.log('');
*/
console.log(colors.blue(' received data [' + colors.cyan(index) + ']...'), data);
}
});
});
Expand Down

0 comments on commit 0ccefdf

Please sign in to comment.