글로는 맞던 문장이 소리로는 끊겼다
메타의 Muse 처럼 말로 대화하고 때가 되면 먼저 챙겨 주는 작은 기기를 만들고 있습니다. 머리는 맥북(M5, 24GB)에서 도는 로컬 모델이고, 몸은 둥근 화면이 달린 기성 ESP32-S3 보드입니다. 보드가 아직 오지 않아서 맥에서 할 수 있는 일부터 했습니다. 매일 아침 날씨와 옷, 첫 일정과 나설 시각, 챙길 메일을 30초 안쪽의 비서 목소리로 들려주는 브리핑입니다.
기기가 오기 전까지는 이 브리핑을 아이폰 웹 화면으로 듣습니다. 화면은 사설망 안에서만 열리고, 그날 글과 소리를 보여 주기만 할 뿐 무엇을 바꾸는 버튼은 없습니다. 맥 캘린더는 전용 도우미 하나만 읽게 했습니다. 파이썬이나 터미널에서 바로 읽으면 맥은 띄운 쪽 프로그램에 권한을 묻고, 허용하면 그 프로그램 전체가 캘린더를 읽게 됩니다. 허용을 받은 뒤 같은 도우미를 AI 와 작업하던 셸에서 띄워 보니 권한이 없다고 나와서, 허용이 도우미에만 묶인 것을 확인했습니다. 보내기, 지우기, 결제처럼 바깥으로 나가는 일은 모델이 판단하지 않고 기기 버튼으로 확인받게 정해 두었습니다.
이 브리핑을 만들며 배운 것은 두 갈래입니다. 글에서 지키던 규칙이 소리에서는 맞지 않았고, 숫자는 모델에게 맡길 수 없었습니다.
첫 소리까지 1.48초
브리핑보다 먼저 대화가 얼마나 빨리 되는지 쟀습니다. 받아쓰기는 whisper large-v3-turbo, 답은 gemma4 12b, 음성 합성은 Qwen3-TTS 1.7B 이고 셋 다 맥에 올려 둔 채입니다. 질문 넷을 세 바퀴 돌린 12번에서, 질문 음성을 넘긴 순간부터 첫 소리까지 가운데 값이 1.48초였고 12번 모두 2초 안이었습니다. 단계별 가운데 값은 받아쓰기 0.39초, 답의 첫 문장 0.75초, 첫 조각 합성 0.34초입니다. 답의 첫 문장이 나오면 바로 합성을 시작하고 나머지는 뒤에 이어 붙여서 나온 값입니다. 말이 끝났는지 알아채는 시간과 기기와 맥 사이의 전송은 아직 들어 있지 않습니다.
처음 전해 받은 값은 이와 달랐습니다. 합성 모델이 한 문장에 5~7초가 걸려 실시간보다 느리다는 것이었는데, 부를 때마다 모델을 올리고 데우는 스크립트로 잰 값이었습니다. 소리 3.76초짜리 같은 문장이 그 스크립트로는 5.26초, 모델을 올려 둔 채로는 2.1초였고 스트리밍 첫 조각은 0.39초에 나왔습니다. 느린 것은 모델이 아니라 재는 방법이었습니다.
합성에는 한 문장씩 넘깁니다. 두 문장을 한 번에 주면 가끔 첫 문장만 읽고 끝났습니다. 다시 시험했을 때는 한 번도 잘리지 않을 만큼 드문 일이었지만, 소리로 나가면 듣는 사람은 반만 듣게 됩니다.
들어 보니 문장마다 끊겼다
매일 아침 저절로 만들어진 브리핑을 들어 보니 문장마다 뚝뚝 끊겼습니다. 재 보니 원인이 둘이었습니다. 하나는 글이었습니다. 지시문에 5~7문장으로 쓰라고 적었더니 모델은 사실 하나에 한 문장씩 끊어서, 7문장에 문장당 25자, 문장을 잇는 말은 한 번뿐인 글을 썼습니다. 눈으로 읽으면 짧고 또렷한 글입니다.
다른 하나는 소리였습니다. 한 문장씩 합성한 소리를 그대로 이으면 문장마다 앞뒤 무음이 붙어 문장 사이가 0.9~1.8초씩 비었습니다. 26.2초짜리 브리핑에서 7.7초가 빈 시간이었습니다. 문장마다 앞뒤 무음을 잘라 내고 0.25초만 띄워 이었더니, 문장 사이가 0.3~0.4초로 줄었습니다.
긴 문장에는 쉼표를 넣어 숨 쉴 자리를 만들려 했는데 합성기는 쉼표에서 쉬지 않았습니다. 쉼표가 셋 든 글에서 0.12초 넘게 쉰 곳이 한 군데도 없었습니다. 지금은 쉼표에서 문장을 조각으로 나눠 따로 읽히고 조각 사이를 0.12초 띄우며, 8자보다 짧은 조각은 이웃 조각에 붙여 읽혀서 이음말만 홀로 떨어지지 않게 했습니다.
이 글을 올린 날 밤, "한 문장씩 넘긴다"와 "쉼표에서 쉬지 않는다"를 뒤집었습니다. 저녁에 브리핑을 다시 들으니 문장 사이 연결과 문장 안 호흡이 어색했고, 조각마다 따로 읽힌 소리를 재 보니 말 빠르기가 초당 5.1~7.4음절, 목소리 높이가 158~200Hz 로 조각마다 달랐습니다. 쉼표 판단도 표를 잘못 읽은 것이었습니다. 0.12~0.3초 칸이 0 인 것만 봤는데, 같은 소리에 0.3초 넘는 쉼이 일곱 번 있었고 문장 이음매 넷과 쉼표 셋을 더한 수와 같았습니다. 같은 문장을 열 번 읽혀도 쉼표에서 0.42~0.61초씩 쉬었습니다. 지금은 두 문장, 55음절까지 묶어 한 번에 읽히고, 모델이 스스로 둔 쉼을 쉼표 0.30초·문장 0.45초로 다듬습니다. 여러 문장을 한 번에 읽힌 23번은 모두 끝까지 읽었습니다.
제가 고쳐 쓴 글을 본으로 삼았다
이어 말하라고만 고친 첫 판은 상관없는 사실까지 '…고'로 이었습니다. 마스크를 챙기라는 말 끝에 이동 시간이 붙는 식이었습니다. 모델이 쓴 글을 제가 직접 고쳐 썼고, 그 글을 본으로 지시문을 다시 짰습니다. 날씨와 옷, 미세먼지와 나서는 길, 일정과 출발, 메일을 덩어리마다 한 문장으로 말하고, 덩어리를 넘어갈 때 '또한', '그리고', '마지막으로'로 엽니다. 긴 문장은 쉼표에서 한 번 쉽니다.
제가 글을 쓸 때 지키는 규칙 가운데 '그리고'나 '그래서'로 문장을 시작하지 않는다는 것이 있고, 이 글도 그 규칙을 따릅니다. 제가 고쳐 쓴 브리핑에는 덩어리를 넘어가는 자리마다 이음말이 들어가 있었습니다. 그 규칙은 눈으로 읽는 글에 대한 것이라, 귀로 듣는 브리핑에서는 이음말을 쓰기로 정했습니다.
본을 따라가는 데도 네 판이 더 걸렸습니다. 사실을 늘어놓지 말고 할 일로 맺으라고 하자 모델은 자료에 없는 할 일을 지어내 "바로 나가세요"라고 했고, 다섯 번 가운데 첫 시도에 검사를 통과한 글이 하나도 없었습니다. 덩어리마다 한 문장으로 묶자 일정 문장이 "오전 10시 25분에는 출발해야 해요"로 줄어 첫 일정과 왜 나서는지가 빠졌습니다. 첫 일정을 꼭 말하라고 적자 이번에는 이유가 빠졌습니다. 지시문만으로는 돌아오지 않아서, 첫 일정 시각과 출발 이유를 코드가 꼭 말할 것에 넣어 검사하게 했습니다.
지시문을 고칠 때마다 전후는 같은 가짜 자료로 견줬습니다. git 에 있는 판과 작업 중인 판을 번갈아 돌려 검사 통과, 문장 수, 이음말 수, 소리 길이와 쉼, 받아 적은 글과의 오류율을 나란히 냅니다. 오류율은 긴 문장이 중간에 잘리지 않았는지 보려고 넣었습니다. 마지막 판은 다섯 번 모두 첫 시도에 통과했고 고치기 전도 다섯 번이었으니, 통과율은 그대로 두고 생김새만 바꾼 셈입니다. 다섯 번 모두 5문장에 이음말 셋, 쉼표 여섯이었습니다. 같은 내용의 소리는 29.4초에서 24.2초로 줄었고, 문장 사이 쉼은 0.64~1.4초에서 0.38~0.7초가 됐습니다. 들어 보고 이 판으로 정했습니다.
숫자와 시각은 코드가 정한다
브리핑의 숫자와 시각은 처음부터 코드가 정했습니다. 기온, 미세먼지 등급, 이동 시간, 출발 시각을 코드가 한국어 사실 줄로 만들고, 모델은 그 줄을 묶어 말로 옮기기만 합니다. 메일 요약에서 모델이 '지난달'을 엉뚱하게 알아들어 기간 계산을 코드로 옮긴 것과 같은 까닭입니다.
모델이 쓴 글은 세 가지로 검사합니다. 자료에 없는 숫자가 있는지, 기온이나 우산, 마스크, 출발 시각처럼 꼭 말할 것이 빠졌는지, 해요체가 아닌 끝맺음이 있는지입니다. 걸리면 무엇이 틀렸는지 알려 주고 최대 세 번 다시 쓰게 합니다. 세 번 다 숫자가 틀리면 모델 글을 버리고 사실 줄을 이어 읽습니다. 틀린 숫자를 소리로 내보내지 않는 것이 먼저입니다. 숫자는 맞고 빠진 것만 남았다면 그중 가장 나은 글을 내보내고 기록에 남깁니다.
검사가 못 잡는 것도 있었습니다. 첫 시험에서 모델은 새벽에 '지금 출발' 기준으로 잰 이동 시간을 오전 8시에 출발할 때 걸리는 시간처럼 바꿔 말했습니다. 숫자는 자료에 있으니 검사를 통과합니다. 이동 시간 줄에 잰 시각을 붙이고, 다른 출발 시각에 갖다 붙이지 말라고 적었습니다. 캘린더 허용 전에 일정 줄이 아예 없자 모델은 "오늘 일정과 메일은 따로 없어요"라고 지어냈습니다. 숫자가 없는 거짓이라 역시 검사로는 못 잡습니다. 지금은 일정을 읽지 못하면 코드가 '확인하지 못했다'는 줄을 넣습니다.
검사기가 틀린 적도 있습니다. 끝맺음 검사가 글 전체에서 '니까'를 찾다 보니, "쌀쌀하니까 코트나" 같은 문장의 연결 어미를 합니다체 끝맺음으로 셌습니다. 멀쩡한 글이 세 번 다 걸려 다시 쓰기만 되풀이했고, 지금은 문장 끝만 봅니다. 인사와 끝인사도 이제 코드가 날짜에 따라 돌아가며 고릅니다. 숫자가 없는 말이라 검사와 부딪치지 않고, 어제와 같은 인사가 이어지지 않습니다.
견준 자료가 맑은 날뿐이었다
새 지시문으로 처음 만든 진짜 브리핑에서 우산과 바람 이야기가 빠졌습니다. 비 올 확률이 높고 바람도 센 날이었는데, 세 번 다시 써도 빠진 채여서 불완전한 글이 그대로 나갔습니다. 바꾼 지시문의 날씨 덩어리에 비와 바람이 들어갈 자리가 없었습니다. 전후를 견줄 때 쓴 가짜 자료가 맑은 날 하나뿐이어서, 비교로는 이 빈자리를 볼 수 없었습니다.
날씨 덩어리에 비, 바람, 자외선을 넣고 비 오는 날 가짜 자료를 더했습니다. 지금은 지시문을 고칠 때마다 맑은 날과 비 오는 날을 둘 다 견줍니다. 마지막 판은 두 날 모두 세 번 다 첫 시도에 통과했고, 고치기 전 판은 비 오는 날 세 번 중 한 번만 첫 시도에 통과했습니다. 같은 비교에서 겹쳐 입을 일이 없는 날에도 본의 꼴을 따라 "겹쳐 입으세요"가 붙는 것이 세 번 중 두 번 보여, 그런 날은 코드가 옷 참고에 '겹쳐 입을 필요는 없다'는 줄을 넣습니다.
검사를 통과한 글이 맞는 글이라는 보장은 없었고, 비교를 통과한 지시문도 비교 자료가 다룬 날까지만 맞았습니다. 시간이 정해진 진짜 일정이 있는 아침에 출발 시각까지 맞게 나오는지는 아직 보지 못했습니다.
정리하면
- 글에서 맞는 규칙이 소리에서도 맞는지는 들어 봐야 압니다. 짧은 문장은 눈에는 또렷했지만 귀에는 끊겼습니다.
- 소리의 쉼은 직접 만듭니다. 문장 앞뒤 무음을 잘라 내고, 쉼표에 기대는 대신 조각을 나눠 쉬게 했습니다. 이 판단은 그날 밤 뒤집어, 지금은 두 문장씩 이어 읽히고 모델이 둔 쉼을 다듬습니다.
- 숫자와 시각은 코드가 정하고, 모델 글은 검사해 다시 쓰게 합니다. 끝내 틀린 숫자는 소리로 내보내지 않습니다.
- 검사와 비교가 무엇을 못 보는지 적어 둡니다. 뜻을 바꾼 숫자, 숫자 없는 거짓, 맑은 날만 든 비교 자료는 모두 통과했습니다.
기간 계산을 코드로 옮긴 이야기는 지난달이 며칠인지는 코드가 정했다에 있습니다.
I am building a small device that, like Meta's Muse, talks with you and checks in first when the time comes. The brain is a local model running on a MacBook (M5, 24GB), and the body is an off-the-shelf ESP32-S3 board with a round screen. The board has not arrived yet, so I started with what could be done on the Mac: a briefing that every morning tells me the weather and what to wear, the first event and when to leave, and the mail to keep an eye on, in an assistant's voice in under 30 seconds.
Until the device arrives, I listen to this briefing through a web page on the iPhone. The page opens only inside a private network, and it only shows that day's text and audio; there is no button that changes anything. The Mac calendar is read by one dedicated helper only. If Python or the terminal reads it directly, macOS asks the program that launched it for permission, and granting it lets that whole program read the calendar. After permission was granted, I launched the same helper from the shell where I was working with the AI and it reported no permission, which confirmed the grant was tied to the helper alone. Anything that goes outside, such as sending, deleting or paying, is set to be confirmed with a button on the device rather than judged by the model.
Building this briefing taught me two things. Rules I kept in writing did not fit in sound, and numbers could not be left to the model.
1.48 seconds to the first sound
Before the briefing, I measured how quickly a conversation could go. Transcription is whisper large-v3-turbo, the answer is gemma4 12b and speech synthesis is Qwen3-TTS 1.7B, all three kept loaded on the Mac. Over 12 runs of four questions three times round, the median from handing over the question audio to the first sound was 1.48 seconds, and all 12 were under 2 seconds. The per-stage medians were 0.39 seconds to transcribe, 0.75 seconds to the first sentence of the answer and 0.34 seconds to synthesise the first piece. These figures come from starting synthesis as soon as the first sentence of the answer appears and appending the rest behind it. The time to notice that speaking has ended, and the transfer between device and Mac, are not included yet.
The figure first passed on to me was different. It said the synthesis model took 5–7 seconds per sentence, slower than real time, but that had been measured with a script that loaded and warmed up the model on every call. The same sentence, 3.76 seconds of audio, took 5.26 seconds with that script and 2.1 seconds with the model kept loaded, and the first streaming piece came out in 0.39 seconds. What was slow was not the model but the way it was measured.
Synthesis is handed one sentence at a time. Given two sentences at once, it occasionally read only the first and stopped. On a retest it was rare enough that nothing was cut even once, but once it goes out as sound, the listener hears only half.
Listening, every sentence broke off
When I listened to the briefing made automatically each morning, it broke off at every sentence. Measuring showed two causes. One was the writing. The instructions said to write 5–7 sentences, so the model cut one sentence per fact and wrote 7 sentences of 25 characters each, with only one connecting word between them. Read with the eyes, it is short, crisp writing.
The other was the sound. Joining audio synthesised one sentence at a time as it is leaves silence at the start and end of every sentence, so 0.9–1.8 seconds went empty between sentences. In a 26.2-second briefing, 7.7 seconds were empty. Trimming the leading and trailing silence of each sentence and joining them with just 0.25 seconds between cut the gaps between sentences to 0.3–0.4 seconds.
I tried putting commas into long sentences to give a place to breathe, but the synthesiser did not pause at commas. In a text with three commas, there was not a single place where it paused for more than 0.12 seconds. Now a sentence is split into pieces at its commas, each piece is read separately with 0.12 seconds between pieces, and pieces shorter than 8 characters are read attached to a neighbouring piece, so a connecting word is never left on its own.
The night this was posted, I reversed both "one sentence at a time" and "it does not pause at commas". Listening to the briefing again that evening, the joins between sentences and the breathing inside them sounded off, and measuring the separately read pieces showed speaking rates of 5.1–7.4 syllables per second and voice pitch of 158–200 Hz, different from piece to piece. The comma judgement came from misreading a table too. I had looked only at the 0.12–0.3 s column being 0; the same audio had seven pauses over 0.3 s, equal to four sentence joins plus three commas. Read ten times, the same sentence paused 0.42–0.61 s at its comma. Now up to two sentences and 55 syllables are read in one go, and the pauses the model makes on its own are trimmed to 0.30 s at commas and 0.45 s at sentence ends. All 23 runs that read several sentences at once read to the end.
My own rewrite became the template
The first version, changed only to say "speak connectedly", joined even unrelated facts with '…고' ("and"). A travel time would be tacked onto the end of a reminder to take a mask. I rewrote the model's text myself and rebuilt the instructions with that text as the template. Weather and clothing, fine dust and heading out, events and departure, and mail are each said in one sentence per block, and moving to the next block opens with "also", "and" or "lastly". A long sentence pauses once at a comma.
One of the rules I keep when writing is not to start a sentence with "and" or "so", and this post follows it too. In the briefing I rewrote, a connecting word sat at every point where it moved on to the next block. That rule is about text read with the eyes, so for a briefing heard with the ears I decided to use connecting words.
Following the template still took four more versions. Told to end with something to do rather than listing facts, the model invented a task that was not in the data and said "Head out now", and of five tries not one passed the check on the first attempt. When each block was bundled into one sentence, the event sentence shrank to "You need to leave by 10:25 a.m.", dropping the first event and why I was leaving. When told to always mention the first event, this time the reason dropped out. Instructions alone did not bring it back, so I put the first event's time and the reason for leaving into what the code requires to be said, and had them checked.
Every time I changed the instructions, before and after were compared on the same fake data. The version in git and the working version are run in turn, and check passes, sentence count, connecting-word count, audio length and pauses, and the error rate against a transcription of the audio come out side by side. The error rate was added to see whether a long sentence got cut off midway. The final version passed on the first try all five times, and the version before the change had also passed five times, so in effect the pass rate stayed the same and only the shape changed. All five had 5 sentences with three connecting words and six commas. The audio for the same content shrank from 29.4 to 24.2 seconds, and the pauses between sentences went from 0.64–1.4 seconds to 0.38–0.7 seconds. I listened and settled on this version.
Code decides the numbers and times
The numbers and times in the briefing were decided by code from the start. Code turns temperature, fine-dust grade, travel time and departure time into Korean fact lines, and the model only bundles those lines and puts them into speech. It is the same reason I moved date arithmetic into code after the model misread "last month" in mail summaries.
The model's text is checked three ways: whether there is a number not in the data, whether something that must be said, such as temperature, umbrella, mask or departure time, is missing, and whether any ending is not in the polite 해요 style. If it fails, the model is told what was wrong and asked to rewrite, up to three times. If the numbers are wrong all three times, the model's text is discarded and the fact lines are read one after another. Not sending a wrong number out as sound comes first. If the numbers are right and only omissions remain, the best of the attempts goes out and is noted in the log.
There were things the check could not catch. In the first test, the model took a travel time measured before dawn on a "leave now" basis and recast it as the time it would take leaving at 8 a.m. The number is in the data, so it passes the check. I attached the measurement time to the travel-time line and wrote not to graft it onto a different departure time. Before calendar permission, when there were no event lines at all, the model made up "There are no events or mail today." It is a falsehood with no number in it, so again the check cannot catch it. Now, when the events cannot be read, the code inserts a line saying they could not be checked.
The checker got it wrong once, too. Because the ending check searched the whole text for '니까', it counted the connective ending in "쌀쌀하니까 코트나" ("it's chilly, so a coat or…") as a formal sentence ending. A perfectly good text failed all three times and was just rewritten over and over; now only the ends of sentences are checked. Greetings and sign-offs are now also picked by the code, rotating by date. They contain no numbers, so they do not clash with the check, and yesterday's greeting does not repeat.
The comparison data held only a clear day
In the first real briefing made with the new instructions, the umbrella and the wind went missing. It was a day with a high chance of rain and strong wind, but they were still missing after three rewrites, so the incomplete text went out as it was. The weather block in the changed instructions had no place for rain and wind. The fake data used for the before-and-after comparison held only a single clear day, so the comparison could not see this gap.
I added rain, wind and UV to the weather block and added fake data for a rainy day. Now every change to the instructions is compared on both a clear day and a rainy day. The final version passed on the first try three times out of three on both days, while the version before the change passed on the first try only once in three on the rainy day. The same comparison showed "layer up" tacked on, following the template's shape, two times out of three even on days with no need to layer, so on such days the code adds a line to the clothing note saying layering is not needed.
Text that passed the check was not guaranteed to be right, and instructions that passed the comparison were right only for the days the comparison data covered. Whether the departure time comes out right on a morning with a real event at a fixed time, I have not seen yet.
In short
- Whether a rule that works in writing also works in sound is known only by listening. Short sentences were crisp to the eye but choppy to the ear.
- Pauses in sound are made by hand. I trimmed the silence before and after sentences, and instead of relying on commas, split them into pieces to make the pauses. That night I reversed this; now two sentences are read together and the pauses the model makes are trimmed.
- Code decides numbers and times, and the model's text is checked and rewritten. A number that stays wrong is never sent out as sound.
- Write down what the check and the comparison cannot see. A number whose meaning changed, a falsehood with no numbers, and comparison data with only a clear day all passed.
The story of moving date arithmetic into code is in Code Decides What Last Month Means.