Skip to content

Commit

Permalink
instance: increase jitter buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
indutny committed Jul 27, 2012
1 parent 918dedf commit c52c1c3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions bin/vock
Expand Up @@ -37,6 +37,9 @@ getAddress(server, function(address, port) {
argv.server = { address: address, port: port };

var instance = vock.instance.create(argv);
instance.on('error', function(err) {
throw err;
});

if (cmd === 'create') {
instance.api.create(function(err, id) {
Expand Down
8 changes: 6 additions & 2 deletions lib/vock/instance.js
Expand Up @@ -13,7 +13,7 @@ function Instance(options) {
this.target = null;
this.rtarget = null;
this.protocol = vock.protocol.create();
this.jitter = vock.jitter.create(options.jitterWindow || 50);
this.jitter = vock.jitter.create(options.jitterWindow || 100);

// Create audio unit
this.audio = vock.audio.create(options.rate || 24000);
Expand Down Expand Up @@ -82,7 +82,11 @@ Instance.prototype.init = function init(options) {
});

this.protocol.on('close', function() {
self.audio.stop();
try {
self.audio.stop();
} catch(e) {
// Ignore
}
});

// Play received data
Expand Down

0 comments on commit c52c1c3

Please sign in to comment.