neurolink
neurolink copied to clipboard
TTS-021: Integrate TTS into BaseProvider.stream()
Summary
Integrate streaming TTS synthesis into the BaseProvider.stream() method.
Technical Details
- File(s): src/lib/core/baseProvider.ts
- Effort: 4h
Acceptance Criteria
- [ ] Check if options.tts?.enabled === true in stream() method
- [ ] Create async generator that yields both text and audio chunks
- [ ] Extract text from each StreamChunk
- [ ] Buffer text chunks and call TTSProcessor.synthesizeStream()
- [ ] Yield original StreamChunk (text) followed by audioChunk
- [ ] Handle errors gracefully
- [ ] Add TTS latency to chunk metadata
- [ ] Document behavior in JSDoc comments
- [ ] Integration test: stream() with TTS returns audio chunks
Dependencies
- Depends on: TTS-001, TTS-004, TTS-009, TTS-013, TTS-017, TTS-019
- Blocks: none
Priority: high | Effort: 4h | Complexity: complex