Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bot_async_transcription/src/bot_async_transcription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export async function bot_async_transcription(args: { msg: TranscriptArtifactEve
});
const readable_transcript_parts = convert_to_readable_transcript({ transcript_parts });

// Write the transcript parts data and readable transcript to files.
// Write the transcript parts data and human-readable transcript to files.
const output_path_events = path.join(
process.cwd(),
`output/recording-${msg.data.recording.id}/transcript.json`,
Expand All @@ -58,7 +58,7 @@ export async function bot_async_transcription(args: { msg: TranscriptArtifactEve
}
fs.writeFileSync(output_path_events, JSON.stringify(transcript_parts, null, 2), { flag: "w+" });

// Write the readable transcript to a file.
// Write the human-readable transcript to a file.
const output_path_readable = path.join(
process.cwd(),
`output/recording-${msg.data.recording.id}/readable.txt`,
Expand All @@ -69,7 +69,7 @@ export async function bot_async_transcription(args: { msg: TranscriptArtifactEve
}
fs.writeFileSync(output_path_readable, readable_transcript_parts.map((t) => t ? `${t.speaker}: ${t.paragraph}` : "").join("\n"), { flag: "w+" });

// Return the transcript parts and readable transcript.
// Return the transcript parts and human-readable transcript.
return {
transcript_parts,
readable_transcript_parts,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export async function bot_async_transcription(args: { msg: TranscriptArtifactEve
const output_path_readable = path.join(output_dir, "hybrid_diarization_transcript.txt");
fs.writeFileSync(output_path_readable, readable_hybrid_transcript_parts.map((t) => t ? `${t.speaker}: ${t.paragraph}` : "").join("\n"), { flag: "w+" });

// Return the transcript parts and readable transcript.
// Return the transcript parts and human-readable transcript.
return {
transcript_parts: hybrid_transcript_parts,
readable_transcript_parts: readable_hybrid_transcript_parts,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export async function bot_real_time_transcription(args: {
);
fs.writeFileSync(output_path_events, JSON.stringify(transcript_parts, null, 2), { flag: "w+" });

// Create the readable transcript from the transcript parts data and write it to a file.
// Create the human-readable transcript from the transcript parts data and write it to a file.
const transcript_readable = convert_to_readable_transcript({ transcript_parts });
fs.writeFileSync(
output_path_readable,
Expand All @@ -47,5 +47,8 @@ export async function bot_real_time_transcription(args: {
);

console.log(`Transcript data written to file: ${output_path_events}`);
console.log(`Readable transcript written to file: ${output_path_readable}`);
console.log(`human-readable transcript written to file: ${output_path_readable}`);

console.log(`${msg.data.data.participant.name ?? msg.data.data.participant.id}: ${msg.data.data.words.map((w) => w.text).join(" ")}`);

}
Loading