diff --git a/bin/vock b/bin/vock index 110c8a4..3e933b5 100755 --- a/bin/vock +++ b/bin/vock @@ -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) { diff --git a/lib/vock/instance.js b/lib/vock/instance.js index c81cd57..b9c90f9 100644 --- a/lib/vock/instance.js +++ b/lib/vock/instance.js @@ -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); @@ -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