Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Short audios fail to play #91

Open
chernikovalexey opened this issue Aug 17, 2014 · 5 comments
Open

Short audios fail to play #91

chernikovalexey opened this issue Aug 17, 2014 · 5 comments

Comments

@chernikovalexey
Copy link

I use it for playing for TTS alongside with Google (http://translate.google.com/translate_tts?ie=UTF-8&q=Ship&tl=en&total=1&idx=0&textlen=4). And, Aurora refuses to play short audio files.

E.g., if I want to play the only word "Ship", nothing happens.

@zo
Copy link

zo commented Dec 20, 2014

Same problem here for making a drum sequencer.

@mdgarrett
Copy link

This is being caused by the ready this.readyMark = 64; in the function Queue(asset) { }

Causes the queue.write method to never emit the ready event (despite else conditional). Guessing race time condition where ended event is never emited. In my case, I'm initializing aurora from a buffer. Once I have confirmed proper patch I will post. Lowering the this.readyMark to a lower number allowed playback, just not best patch to push.

@mdgarrett
Copy link

Abstracted out following logic from Queue.prototype.write:
if (this.buffers.length >= this.readyMark || this.ended) {
console.log('Queue.write: no longer buffering and ready. buffers.length ' + this.buffers.length + ', this ended: ' + this.ended);
this.buffering = false;
return this.emit('ready');
} else {
console.log('Queue.write: still buffering');
return this.asset.decodePacket();
}

into own function. Calling function from:
this.asset.on('end', (function(_this) {
return function () {
console.log('ended marked');
_this.ended = true;
_this.CheckReady();
return;
};
})(this));

This has short file playback issue working properly for me. Doing additional testing then will do a push for it to potentially be pulled in for a fix.

@mdgarrett
Copy link

And forgot my skills with coffeescript are almost non-existent. I will do my best to get the above fixed and implemented properly. Until then, if you find the location of the above and do the same logic, the short playback will occur. Mainly just need to add the logic on the 'end' event to check again if it can initialize.

@Jason121250148
Copy link

Same problem here, any solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants