-
Notifications
You must be signed in to change notification settings - Fork 132
Shubhra/ajs 37 refactor tts with streams #402
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
base: dev-1.0
Are you sure you want to change the base?
Conversation
|
private input = new IdentityTransform<AudioFrame | typeof VADStream.FLUSH_SENTINEL>(); | ||
private output = new IdentityTransform<VADEvent>(); | ||
private metricsStream: ReadableStream<VADEvent>; | ||
private outputReader: ReadableStreamDefaultReader<VADEvent>; | ||
private inputWriter: WritableStreamDefaultWriter<AudioFrame | typeof VADStream.FLUSH_SENTINEL>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making access modifiers more restrictive . Forgot to do it in #390
if (!this.inputClosed) { | ||
this.inputWriter.close(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forgot to do in #390
SynthesizedAudio | typeof SynthesizeStream.END_OF_STREAM | ||
>; | ||
private logger = log(); | ||
private inputClosed = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is duplicative. The Readable/WritableStreamDefaultWriter internally tracks whether it's closed but doesn't expose it. The only way to know is when you try to write to or close an already-closed writer, it throws an error.
The other option would be to
try {
this.inputWriter.write(SynthesizeStream.FLUSH_SENTINEL);
} catch (error) {
throw new Error('Input is closed');
}
everywhere, which doesn't seem much better. Let me know what you thoughts are @lukasIO @toubatbrian
Similar to #390