936c6d71db
The WAV parser now walks chunk headers to find the data chunk instead of scanning for the four bytes "data". A LIST chunk between fmt and data is common, arecord and ffmpeg both write one, and its payload is free text that can spell the word. A byte scan took that text for a chunk header and read the comment as samples. WAVHeader named WAVFromPCM in its error, so a caller of WAVHeader read the wrong function. internal/capture calls it twice. PCMFromWAV returns PCM that aliases the buffer it was given. That is the right trade for a long recording and it was undocumented, so the doc comment now says so and names the two ways a caller gets it wrong. The TTS stub wrote 16000 three times. It reads the rate and the sample width off audio.PCM16kMono now, so the tone stays in tune with the shape the seam declares, and the sample write goes through binary.LittleEndian. Identify computed the clip length twice to report it once. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>