Added playStream and renamed some functions

This commit is contained in:
hydrabolt
2015-11-08 12:55:10 +00:00
parent 639fc99b86
commit 71786148bc
3 changed files with 10 additions and 15 deletions

View File

@@ -56,7 +56,7 @@ class VoiceConnection extends EventEmitter {
}
}
playRawStream(stream) {
playStream(stream) {
var self = this;
@@ -193,20 +193,19 @@ class VoiceConnection extends EventEmitter {
.catch(error)
.then(data => {
self.streamProc = data.proc;
var intent = self.playRawStream(data.stream);
var intent = self.playStream(data.stream);
resolve(intent);
callback(null, intent);
});
function error(e = true) {
console.log(e);
reject(e);
callback(e);
}
})
}
playStream(stream, callback = function (err, str) { }) {
playRawStream(stream, callback = function (err, str) { }) {
var self = this;
return new Promise((resolve, reject) => {
this.encoder
@@ -215,13 +214,12 @@ class VoiceConnection extends EventEmitter {
.then(data => {
self.streamProc = data.proc;
self.instream = data.instream;
var intent = self.playRawStream(data.stream);
var intent = self.playStream(data.stream);
resolve(intent);
callback(null, intent);
});
function error(e = true) {
console.log(e);
reject(e);
callback(e);
}