DailyTransport: add transport_source to transcription frames
This commit is contained in:
1
changelog/3257.changed.2.md
Normal file
1
changelog/3257.changed.2.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
- `TranscriptionFrame` and `InterimTranscriptionFrame` produced by `DailyTransport` now include the transport source (i.e., the originating audio track).
|
||||||
@@ -2651,6 +2651,7 @@ class DailyTransport(BaseTransport):
|
|||||||
|
|
||||||
text = message["text"]
|
text = message["text"]
|
||||||
timestamp = message["timestamp"]
|
timestamp = message["timestamp"]
|
||||||
|
track_type = message.get("trackType", None)
|
||||||
raw_response = message.get("rawResponse", {})
|
raw_response = message.get("rawResponse", {})
|
||||||
is_final = raw_response.get("is_final", False)
|
is_final = raw_response.get("is_final", False)
|
||||||
try:
|
try:
|
||||||
@@ -2669,6 +2670,7 @@ class DailyTransport(BaseTransport):
|
|||||||
language,
|
language,
|
||||||
result=message,
|
result=message,
|
||||||
)
|
)
|
||||||
|
frame.transport_source = track_type
|
||||||
|
|
||||||
if self._input:
|
if self._input:
|
||||||
await self._input.push_transcription_frame(frame)
|
await self._input.push_transcription_frame(frame)
|
||||||
|
|||||||
Reference in New Issue
Block a user