fetch reader chunk boundaries do not align to PCM16 sample
boundaries, so an odd-length read dropped its final byte and
misaligned every subsequent sample into noise. Carry the odd
byte forward via a persistent leftover buffer (now covering the
data path, not just the WAV header) and only decode whole samples.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fix Safari streaming: use fetch+WebAudio; DataView bugfix
Add ability to paste an article URL, extract its text content using
trafilatura, and stream TTS audio from the extracted text.
- New url_extract module with validation, error handling, truncation
- POST /extract_url endpoint for article text extraction
- POST /stream endpoint for long text (>2000 chars) via request body
- Text/URL tab toggle in client UI with extraction metadata chips
- Auto-switch to text mode after extraction for review before streaming
refactor: remove dead code, extract constants, prevent stale closure
- Remove unused <audio> element, audioRef, and empty event handlers
- Extract SAMPLE_RATE (24000) and SEGMENT_CHAR_SIZE (160) as constants
- Pass selectedVoice as explicit param to fetchVoices to prevent potential stale closure
fix: correct download filename typo, color key naming, unhandled stream errors, and remove default text
- Fix typo `vienau_tts` → `vieneu_tts` in WAV download filename
- Rename Tailwind color key `violet` → `amber` to match actual value (#f59e0b)
- Add `await` to `processStream()` call to prevent unhandled promise rejections
and UI getting stuck on CONNECTING state when stream errors occur
- Remove hardcoded 2000+ chars Vietnamese essay from textarea default state;
placeholder text is sufficient for guiding users