Skip to content

Commit a77d633

Browse files
committed
Fix elevenlabs processor
1 parent 0770860 commit a77d633

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

TODO.org

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,6 @@ CLOSED: [2025-01-20 Lun 07:43]
106106

107107
* TODO add core.async.flow support
108108
:LOGBOOK:
109+
CLOCK: [2025-01-25 Sat 11:14]
109110
CLOCK: [2025-01-25 Sat 09:50]--[2025-01-25 Sat 10:15] => 0:25
110111
:END:

core/src/voice_fn/experiments/flow.clj

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
:on-close (fn [_ws code reason]
156156
(reset! alive? false)
157157
(t/log! :info ["Elevenlabs websocket connection closed" "Code:" code "Reason:" reason]))}
158-
_ (t/log! {:level :info :id :deepgram-transcriptor} "Connecting to transcription websocket")
158+
_ (t/log! {:level :info :id :elevenlabs} "Connecting to transcription websocket")
159159
ws-conn @(ws/websocket
160160
url
161161
conf)
@@ -197,7 +197,7 @@
197197
(let [attempt (u/parse-if-json (str acc msg))]
198198
(if (map? attempt)
199199
[(assoc state :audio/acc "") (when-let [audio (:audio attempt)]
200-
{:out (frame/audio-output-raw (u/decode-base64 audio))})]
200+
{:out [(frame/audio-output-raw (u/decode-base64 audio))]})]
201201
;; continue concatenating
202202
[(assoc state :audio/acc attempt)]))
203203
(cond
@@ -240,10 +240,8 @@
240240
llm-write (a/chan 100)
241241
llm-read (a/chan 1024)
242242
write-to-llm #(loop []
243-
(t/log! {:level :info :id :llm} "Starting LLM loop")
244243
(if-let [msg (a/<!! llm-write)]
245244
(do
246-
(t/log! {:level :debug :id :llm} ["LLM CONTEXT" msg])
247245
(assert (or (frame/llm-context? msg)
248246
(frame/control-interrupt-start? msg)) "Invalid frame sent to LLM. Only llm-context or interrupt-start")
249247
(openai/flow-do-completion! state llm-read msg)
@@ -264,7 +262,7 @@
264262
([] {:ins {:in "Channel for llm text chunks"}
265263
:outs {:out "Channel for assembled speak frames"}})
266264
([_] {:acc nil})
267-
([{:keys [acc]} msg]
265+
([{:keys [acc]} _ msg]
268266
(when (frame/llm-text-chunk? msg)
269267
(let [{:keys [sentence accumulator]} (u/assemble-sentence acc (:frame/data msg))]
270268
(if sentence
@@ -310,7 +308,10 @@
310308
:elevenlabs/voice-id "7sJPxFeMXAVWZloGIqg2"
311309
:voice/stability 0.5
312310
:voice/similarity-boost 0.8
313-
:voice/use-speaker-boost? true}}
311+
:voice/use-speaker-boost? true
312+
:flow/language :en
313+
:audio.out/encoding :ulaw
314+
:audio.out/sample-rate 8000}}
314315

315316
:print-sink {:proc (flow/process
316317
{:describe (fn [] {:ins {:in "Channel for receiving transcriptions"}})

0 commit comments

Comments
 (0)