BoldTranscriptsEx.Convert.AssemblyAI (bold_transcripts_ex v0.4.2)

Handles conversion of AssemblyAI transcription files to Bold format.

Summary

Functions

Converts chapter data extracted from an AssemblyAI transcript JSON to WebVTT format.

Converts an AssemblyAI transcript to the Bold Transcript format.

Functions

chapters_to_webvtt(transcript, opts \\ [])

Converts chapter data extracted from an AssemblyAI transcript JSON to WebVTT format.

Parameters

  • transcript_json: The JSON string of the full transcript data from AssemblyAI, which includes chapters.
  • opts: Optional parameters for the conversion (unused for now, but included for future flexibility).

Returns

  • A string in WebVTT format representing the chapters.

Examples

iex> transcript_json = "{...}" # Your full transcript JSON string here
iex> BoldTranscriptsEx.Convert.AssemblyAI.chapters_to_webvtt(transcript_json)
"WEBVTT

1 00:00:01.000 --> 00:00:05.000 Chapter 1

Summary of chapter 1

"

transcript_to_bold(transcript, opts)

Converts an AssemblyAI transcript to the Bold Transcript format.

Parameters

  • main_transcript: The JSON string of the main transcript data from AssemblyAI.
  • opts: Options for the conversion. Can include :paragraphs and :sentences data as JSON strings.

Returns

  • {:ok, merged_data}: A tuple with :ok atom and the merged data in Bold Transcript format.

Examples

iex> BoldTranscriptsEx.Convert.AssemblyAI.transcript_to_bold(main_transcript)
{:ok, %{"metadata" => metadata, "utterances" => utterances, "paragraphs" => paragraphs}}