transcript¶
Transcript generation module for Direktor.
direktor.core.transcript
¶
Transcript generation module for Direktor.
This module handles podcast script generation and audio transcription.
aggregate_chunks(chunks, target_duration=30)
¶
Aggregate transcript chunks into segments of approximately target duration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chunks
|
List of transcript chunks with timestamps |
required | |
target_duration
|
Target duration in seconds for each segment |
30
|
Returns:
| Type | Description |
|---|---|
|
List of aggregated chunks |
Source code in direktor/core/transcript.py
generate_podcast_script(input_text, temp_dir)
¶
Generate a podcast script from input text using GPT.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_text
|
The text to convert into a podcast script |
required | |
temp_dir
|
Temporary directory for output files |
required |
Returns:
| Type | Description |
|---|---|
|
The generated podcast script |
Source code in direktor/core/transcript.py
generate_transcript(audio_file, temp_dir)
¶
Generate a transcript from an audio file using Whisper.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
audio_file
|
Path to the audio file |
required | |
temp_dir
|
Temporary directory for intermediate files |
required |
Returns:
| Type | Description |
|---|---|
|
Transcript dictionary with chunks and timestamps, or None on failure |