API
Modules:
| Name | Description |
|---|---|
config |
|
container |
|
execution |
|
factories |
|
interfaces |
|
main |
Main module for the Whisper TikTok application. |
processors |
|
repositories |
|
services |
|
strategies |
|
utils |
|
voice_manager |
|
Classes:
| Name | Description |
|---|---|
Application |
Main application class responsible for orchestrating the video creation pipeline. |
CommandExecutor |
Executes external commands with error handling. |
Container |
IoC container for dependency injection. |
FFmpegService |
Service for FFmpeg operations. |
TTSService |
Text-to-Speech service using a hypothetical TTS engine. |
TranscriptionService |
Service for transcribing audio using Whisper. |
VideoCreatorFactory |
Factory for creating video processor instances. |
VideoDownloaderService |
YouTube video downloader using yt-dlp. |
VoicesManager |
Wrapper for edge_tts VoicesManager. |
Functions:
| Name | Description |
|---|---|
create |
Create videos from text content. |
list_voices |
List available TTS voices. |
rgb_to_bgr |
Convert RGB hex to BGR hex. |
setup_logger |
Configure and return a logger instance. |
Application
Main application class responsible for orchestrating the video creation pipeline. This class loads video data from a JSON file, builds configuration from a container, and processes each video asynchronously using a factory-created processor.
Attributes:
| Name | Type | Description |
|---|---|---|
container |
Container
|
Dependency injection container. |
logger |
Logger
|
Logger instance for logging operations. |
Methods:
| Name | Description |
|---|---|
run |
Main method to run the video creation pipeline. |
Source code in whisper_tiktok/main.py
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 | |
run()
async
Run the video creation pipeline.
Returns:
| Type | Description |
|---|---|
None
|
None |
Source code in whisper_tiktok/main.py
CommandExecutor
Executes external commands with error handling.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
logger
|
Logger
|
Logger instance for logging. |
required |
Methods:
| Name | Description |
|---|---|
execute |
Execute command and return result. |
Source code in whisper_tiktok/execution/command_executor.py
execute(command, cwd=None, timeout=None)
Execute command and return result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
command
|
str
|
Command to execute. |
required |
cwd
|
Path | None
|
Working directory for command execution. |
None
|
timeout
|
int | None
|
Timeout in seconds for command execution. |
None
|
Returns:
| Type | Description |
|---|---|
ExecutionResult
|
ExecutionResult containing return code, stdout, and stderr. |
Source code in whisper_tiktok/execution/command_executor.py
Container
Bases: DeclarativeContainer
IoC container for dependency injection.
Source code in whisper_tiktok/container.py
FFmpegService
Service for FFmpeg operations.
Methods:
| Name | Description |
|---|---|
compose_video |
Compose final video with background, audio, and subtitles. |
get_media_info |
Get media information using ffprobe. |
Source code in whisper_tiktok/services/ffmpeg_service.py
compose_video(background, audio, subtitles, output, start_time, duration)
Compose final video with background, audio, and subtitles.
Source code in whisper_tiktok/services/ffmpeg_service.py
get_media_info(file_path)
Get media information using ffprobe.
Source code in whisper_tiktok/services/ffmpeg_service.py
TTSService
Bases: ITTSService
Text-to-Speech service using a hypothetical TTS engine.
Methods:
| Name | Description |
|---|---|
synthesize |
Synthesize speech from text and save to output file. |
Source code in whisper_tiktok/services/tts_service.py
synthesize(text, output_file, voice='en-US-ChristopherNeural')
async
Synthesize speech from text and save to output file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
The text to be converted to speech. |
required |
output_file
|
Path
|
The path to save the synthesized audio file. |
required |
voice
|
str
|
The voice to be used for synthesis. |
'en-US-ChristopherNeural'
|
Source code in whisper_tiktok/services/tts_service.py
TranscriptionService
Bases: ITranscriptionService
Service for transcribing audio using Whisper.
Source code in whisper_tiktok/services/transcription_service.py
VideoCreatorFactory
Factory for creating video processor instances.
Methods:
| Name | Description |
|---|---|
create_processor |
Create a configured video processor. |
Source code in whisper_tiktok/factories/video_factory.py
create_processor(video_data, config)
Create a configured video processor.
Source code in whisper_tiktok/factories/video_factory.py
VideoDownloaderService
Bases: IVideoDownloader
YouTube video downloader using yt-dlp.
Methods:
| Name | Description |
|---|---|
download |
Download video from URL. |
Source code in whisper_tiktok/services/video_downloader.py
download(url, output_dir)
Download video from URL.
Source code in whisper_tiktok/services/video_downloader.py
VoicesManager
Wrapper for edge_tts VoicesManager.
Methods:
| Name | Description |
|---|---|
create |
Create and return voices manager object. |
find |
Find a voice by gender and locale. |
Source code in whisper_tiktok/voice_manager.py
create()
async
staticmethod
find(voices, gender, locale)
staticmethod
Find a voice by gender and locale.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
voices
|
Voices manager object from create() |
required | |
gender
|
str
|
Gender filter (Male/Female) |
required |
locale
|
str
|
Language locale filter (e.g., en-US) |
required |
Returns:
| Type | Description |
|---|---|
Any
|
Dictionary with voice information |
Raises:
| Type | Description |
|---|---|
ValueError
|
If no voice found |
Source code in whisper_tiktok/voice_manager.py
create(model=typer.Option('turbo', '--model', '-m', help='Whisper model size [tiny|base|small|medium|large|turbo]'), background_url=typer.Option('https://www.youtube.com/watch?v=intRX7BRA90', '--background-url', '-u', help='YouTube URL for background video'), tts_voice=typer.Option('en-US-ChristopherNeural', '--tts', '-v', help='TTS voice to use'), random_voice=typer.Option(False, '--random-voice', help='Use random TTS voice'), gender=typer.Option(None, '--gender', '-g', help='Gender for random voice (Male/Female)'), language=typer.Option(None, '--language', '-l', help='Language for random voice (e.g., en-US)'), font=typer.Option('Lexend Bold', '--font', '-f', help='Subtitle font'), font_size=typer.Option(21, '--font-size', help='Subtitle font size'), font_color=typer.Option('FFF000', '--font-color', '-c', help='Subtitle color (hex format)'), sub_position=typer.Option(5, '--sub-position', '-p', help='Subtitle position (1-9)', min=1, max=9), upload_tiktok=typer.Option(False, '--upload-tiktok', help='Upload to TikTok'), clean=typer.Option(False, '--clean', help='Clean media and output folders before processing'), verbose=typer.Option(False, '--verbose', help='Enable verbose logging'))
Create videos from text content.
Source code in whisper_tiktok/main.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | |
list_voices(language=typer.Option(None, '--language', '-l', help='Filter by language (e.g., en-US)'), gender=typer.Option(None, '--gender', '-g', help='Filter by gender (Male/Female)'))
List available TTS voices.
Source code in whisper_tiktok/main.py
rgb_to_bgr(rgb)
Convert RGB hex to BGR hex.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rgb
|
str
|
RGB hex string (e.g., "#RRGGBB" or "RRGGBB") |
required |
Returns:
| Type | Description |
|---|---|
str
|
BGR hex string (e.g., "BBGGRR") |
Source code in whisper_tiktok/utils/color_utils.py
setup_logger(log_dir, log_level='INFO')
Configure and return a logger instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
log_dir
|
Path
|
Directory to store log files |
required |
log_level
|
str
|
Logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL) |
'INFO'
|
Returns:
| Type | Description |
|---|---|
Logger
|
Configured logger instance |
Source code in whisper_tiktok/config/logger_config.py
config
Modules:
| Name | Description |
|---|---|
logger_config |
Logger configuration module. |
logger_config
Logger configuration module.
Functions:
| Name | Description |
|---|---|
setup_logger |
Configure and return a logger instance. |
setup_logger(log_dir, log_level='INFO')
Configure and return a logger instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
log_dir
|
Path
|
Directory to store log files |
required |
log_level
|
str
|
Logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL) |
'INFO'
|
Returns:
| Type | Description |
|---|---|
Logger
|
Configured logger instance |
Source code in whisper_tiktok/config/logger_config.py
container
Classes:
| Name | Description |
|---|---|
Container |
IoC container for dependency injection. |
Container
Bases: DeclarativeContainer
IoC container for dependency injection.
Source code in whisper_tiktok/container.py
execution
Modules:
| Name | Description |
|---|---|
command_executor |
|
command_executor
Classes:
| Name | Description |
|---|---|
CommandExecutionError |
Custom exception for command execution errors. |
CommandExecutor |
Executes external commands with error handling. |
CommandTimeoutError |
Custom exception for command timeouts. |
ExecutionResult |
Result of command execution. |
CommandExecutionError
CommandExecutor
Executes external commands with error handling.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
logger
|
Logger
|
Logger instance for logging. |
required |
Methods:
| Name | Description |
|---|---|
execute |
Execute command and return result. |
Source code in whisper_tiktok/execution/command_executor.py
execute(command, cwd=None, timeout=None)
Execute command and return result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
command
|
str
|
Command to execute. |
required |
cwd
|
Path | None
|
Working directory for command execution. |
None
|
timeout
|
int | None
|
Timeout in seconds for command execution. |
None
|
Returns:
| Type | Description |
|---|---|
ExecutionResult
|
ExecutionResult containing return code, stdout, and stderr. |
Source code in whisper_tiktok/execution/command_executor.py
CommandTimeoutError
ExecutionResult
dataclass
Result of command execution.
Attributes:
| Name | Type | Description |
|---|---|---|
success |
bool
|
Indicates if the command executed successfully. |
Source code in whisper_tiktok/execution/command_executor.py
success
property
Indicates if the command executed successfully.
factories
Modules:
| Name | Description |
|---|---|
video_factory |
|
video_factory
Classes:
| Name | Description |
|---|---|
VideoCreatorFactory |
Factory for creating video processor instances. |
VideoCreatorFactory
Factory for creating video processor instances.
Methods:
| Name | Description |
|---|---|
create_processor |
Create a configured video processor. |
Source code in whisper_tiktok/factories/video_factory.py
create_processor(video_data, config)
Create a configured video processor.
Source code in whisper_tiktok/factories/video_factory.py
interfaces
Modules:
| Name | Description |
|---|---|
transcription_service |
|
tts_service |
|
video_downloader |
|
transcription_service
Classes:
| Name | Description |
|---|---|
ITranscriptionService |
Interface for transcription services. |
ITranscriptionService
Bases: ABC
Interface for transcription services.
Methods:
| Name | Description |
|---|---|
transcribe |
Transcribe audio and generate SRT/ASS files. |
Source code in whisper_tiktok/interfaces/transcription_service.py
transcribe(audio_file, srt_file, ass_file, model, options)
abstractmethod
Transcribe audio and generate SRT/ASS files.
tts_service
Classes:
| Name | Description |
|---|---|
ITTSService |
Interface for text-to-speech services. |
ITTSService
Bases: ABC
Interface for text-to-speech services.
Methods:
| Name | Description |
|---|---|
synthesize |
Synthesize speech from text. |
Source code in whisper_tiktok/interfaces/tts_service.py
video_downloader
Classes:
| Name | Description |
|---|---|
IVideoDownloader |
Interface for video downloading services. |
IVideoDownloader
Bases: ABC
Interface for video downloading services.
Methods:
| Name | Description |
|---|---|
download |
Download video from URL to output directory. |
Source code in whisper_tiktok/interfaces/video_downloader.py
main
Main module for the Whisper TikTok application.
Classes:
| Name | Description |
|---|---|
Application |
Main application class responsible for orchestrating the video creation pipeline. |
Functions:
| Name | Description |
|---|---|
create |
Create videos from text content. |
list_voices |
List available TTS voices. |
main |
Whisper TikTok - Create TikTok videos with AI-generated subtitles. |
Application
Main application class responsible for orchestrating the video creation pipeline. This class loads video data from a JSON file, builds configuration from a container, and processes each video asynchronously using a factory-created processor.
Attributes:
| Name | Type | Description |
|---|---|---|
container |
Container
|
Dependency injection container. |
logger |
Logger
|
Logger instance for logging operations. |
Methods:
| Name | Description |
|---|---|
run |
Main method to run the video creation pipeline. |
Source code in whisper_tiktok/main.py
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 | |
run()
async
Run the video creation pipeline.
Returns:
| Type | Description |
|---|---|
None
|
None |
Source code in whisper_tiktok/main.py
create(model=typer.Option('turbo', '--model', '-m', help='Whisper model size [tiny|base|small|medium|large|turbo]'), background_url=typer.Option('https://www.youtube.com/watch?v=intRX7BRA90', '--background-url', '-u', help='YouTube URL for background video'), tts_voice=typer.Option('en-US-ChristopherNeural', '--tts', '-v', help='TTS voice to use'), random_voice=typer.Option(False, '--random-voice', help='Use random TTS voice'), gender=typer.Option(None, '--gender', '-g', help='Gender for random voice (Male/Female)'), language=typer.Option(None, '--language', '-l', help='Language for random voice (e.g., en-US)'), font=typer.Option('Lexend Bold', '--font', '-f', help='Subtitle font'), font_size=typer.Option(21, '--font-size', help='Subtitle font size'), font_color=typer.Option('FFF000', '--font-color', '-c', help='Subtitle color (hex format)'), sub_position=typer.Option(5, '--sub-position', '-p', help='Subtitle position (1-9)', min=1, max=9), upload_tiktok=typer.Option(False, '--upload-tiktok', help='Upload to TikTok'), clean=typer.Option(False, '--clean', help='Clean media and output folders before processing'), verbose=typer.Option(False, '--verbose', help='Enable verbose logging'))
Create videos from text content.
Source code in whisper_tiktok/main.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | |
list_voices(language=typer.Option(None, '--language', '-l', help='Filter by language (e.g., en-US)'), gender=typer.Option(None, '--gender', '-g', help='Filter by gender (Male/Female)'))
List available TTS voices.
Source code in whisper_tiktok/main.py
processors
Modules:
| Name | Description |
|---|---|
video_processor |
|
video_processor
Classes:
| Name | Description |
|---|---|
ProcessingResult |
Result of video processing. |
VideoProcessor |
Main orchestrator for video processing pipeline. |
ProcessingResult
dataclass
VideoProcessor
Main orchestrator for video processing pipeline.
Methods:
| Name | Description |
|---|---|
process |
Execute the processing pipeline. |
Source code in whisper_tiktok/processors/video_processor.py
process()
async
Execute the processing pipeline.
Source code in whisper_tiktok/processors/video_processor.py
repositories
Modules:
| Name | Description |
|---|---|
video_repository |
|
video_repository
Classes:
| Name | Description |
|---|---|
VideoRepository |
Repository for video-related file operations. |
VideoRepository
Repository for video-related file operations.
Methods:
| Name | Description |
|---|---|
get_background_videos |
Get list of available background videos. |
random_background |
Get random background video. |
save_audio |
Save audio file. |
Source code in whisper_tiktok/repositories/video_repository.py
get_background_videos()
random_background()
Get random background video.
save_audio(uuid, data)
Save audio file.
services
Modules:
| Name | Description |
|---|---|
ffmpeg_service |
|
transcription_service |
|
tts_service |
|
video_downloader |
|
ffmpeg_service
Classes:
| Name | Description |
|---|---|
FFmpegError |
Custom exception for FFmpeg errors. |
FFmpegService |
Service for FFmpeg operations. |
MediaInfo |
Represents the result of running FFprobe. |
FFmpegError
FFmpegService
Service for FFmpeg operations.
Methods:
| Name | Description |
|---|---|
compose_video |
Compose final video with background, audio, and subtitles. |
get_media_info |
Get media information using ffprobe. |
Source code in whisper_tiktok/services/ffmpeg_service.py
compose_video(background, audio, subtitles, output, start_time, duration)
Compose final video with background, audio, and subtitles.
Source code in whisper_tiktok/services/ffmpeg_service.py
get_media_info(file_path)
Get media information using ffprobe.
Source code in whisper_tiktok/services/ffmpeg_service.py
MediaInfo
Bases: NamedTuple
Represents the result of running FFprobe.
Attributes:
| Name | Type | Description |
|---|---|---|
return_code |
int
|
The return code of the FFprobe process. |
json |
str
|
The JSON output from FFprobe. |
error |
str
|
The error message from FFprobe, if any. |
Methods:
| Name | Description |
|---|---|
convert_time |
Converts time in seconds to a string in the format "hh |
from_json |
Creates a MediaInfo instance from FFprobe execution result. |
Source code in whisper_tiktok/services/ffmpeg_service.py
duration
property
Extracts the duration of the audio stream from the FFprobe JSON output.
convert_time(time_in_seconds)
staticmethod
Converts time in seconds to a string in the format "hhss.mmm".
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time_in_seconds
|
float
|
The time in seconds to be converted. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The time in the format "hh |
Source code in whisper_tiktok/services/ffmpeg_service.py
from_json(result)
staticmethod
Creates a MediaInfo instance from FFprobe execution result.
transcription_service
Classes:
| Name | Description |
|---|---|
TranscriptionService |
Service for transcribing audio using Whisper. |
TranscriptionService
Bases: ITranscriptionService
Service for transcribing audio using Whisper.
Source code in whisper_tiktok/services/transcription_service.py
tts_service
Classes:
| Name | Description |
|---|---|
TTSService |
Text-to-Speech service using a hypothetical TTS engine. |
TTSService
Bases: ITTSService
Text-to-Speech service using a hypothetical TTS engine.
Methods:
| Name | Description |
|---|---|
synthesize |
Synthesize speech from text and save to output file. |
Source code in whisper_tiktok/services/tts_service.py
synthesize(text, output_file, voice='en-US-ChristopherNeural')
async
Synthesize speech from text and save to output file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
The text to be converted to speech. |
required |
output_file
|
Path
|
The path to save the synthesized audio file. |
required |
voice
|
str
|
The voice to be used for synthesis. |
'en-US-ChristopherNeural'
|
Source code in whisper_tiktok/services/tts_service.py
video_downloader
Classes:
| Name | Description |
|---|---|
VideoDownloadError |
Custom exception for video download errors. |
VideoDownloaderService |
YouTube video downloader using yt-dlp. |
VideoDownloadError
VideoDownloaderService
Bases: IVideoDownloader
YouTube video downloader using yt-dlp.
Methods:
| Name | Description |
|---|---|
download |
Download video from URL. |
Source code in whisper_tiktok/services/video_downloader.py
download(url, output_dir)
Download video from URL.
Source code in whisper_tiktok/services/video_downloader.py
strategies
Modules:
| Name | Description |
|---|---|
processing_strategy |
|
processing_strategy
Classes:
| Name | Description |
|---|---|
DownloadBackgroundStrategy |
Strategy for downloading background video. |
ProcessingContext |
Context object passed through processing pipeline. |
ProcessingStrategy |
Base strategy for video processing steps. |
TTSGenerationStrategy |
Strategy for generating TTS audio. |
TikTokUploadStrategy |
Strategy for uploading videos to TikTok. |
TranscriptionStrategy |
Strategy for transcribing audio to generate subtitles. |
VideoCompositionStrategy |
Strategy for composing the final video. |
DownloadBackgroundStrategy
Bases: ProcessingStrategy
Strategy for downloading background video.
Source code in whisper_tiktok/strategies/processing_strategy.py
ProcessingContext
dataclass
Context object passed through processing pipeline.
Source code in whisper_tiktok/strategies/processing_strategy.py
ProcessingStrategy
Bases: ABC
Base strategy for video processing steps.
Methods:
| Name | Description |
|---|---|
execute |
Execute processing step and update context. |
Source code in whisper_tiktok/strategies/processing_strategy.py
TTSGenerationStrategy
Bases: ProcessingStrategy
Strategy for generating TTS audio.
Methods:
| Name | Description |
|---|---|
execute |
Integrates TTS into the pipeline |
Source code in whisper_tiktok/strategies/processing_strategy.py
execute(context)
async
Integrates TTS into the pipeline
Source code in whisper_tiktok/strategies/processing_strategy.py
TikTokUploadStrategy
Bases: ProcessingStrategy
Strategy for uploading videos to TikTok.
Source code in whisper_tiktok/strategies/processing_strategy.py
TranscriptionStrategy
Bases: ProcessingStrategy
Strategy for transcribing audio to generate subtitles.
Source code in whisper_tiktok/strategies/processing_strategy.py
VideoCompositionStrategy
Bases: ProcessingStrategy
Strategy for composing the final video.
Source code in whisper_tiktok/strategies/processing_strategy.py
utils
Modules:
| Name | Description |
|---|---|
color_utils |
|
color_utils
Functions:
| Name | Description |
|---|---|
rgb_to_bgr |
Convert RGB hex to BGR hex. |
validate_hex_color |
Validate if the input string is a valid hex color. |
rgb_to_bgr(rgb)
Convert RGB hex to BGR hex.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rgb
|
str
|
RGB hex string (e.g., "#RRGGBB" or "RRGGBB") |
required |
Returns:
| Type | Description |
|---|---|
str
|
BGR hex string (e.g., "BBGGRR") |
Source code in whisper_tiktok/utils/color_utils.py
validate_hex_color(color)
voice_manager
Classes:
| Name | Description |
|---|---|
VoicesManager |
Wrapper for edge_tts VoicesManager. |
VoicesManager
Wrapper for edge_tts VoicesManager.
Methods:
| Name | Description |
|---|---|
create |
Create and return voices manager object. |
find |
Find a voice by gender and locale. |
Source code in whisper_tiktok/voice_manager.py
create()
async
staticmethod
find(voices, gender, locale)
staticmethod
Find a voice by gender and locale.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
voices
|
Voices manager object from create() |
required | |
gender
|
str
|
Gender filter (Male/Female) |
required |
locale
|
str
|
Language locale filter (e.g., en-US) |
required |
Returns:
| Type | Description |
|---|---|
Any
|
Dictionary with voice information |
Raises:
| Type | Description |
|---|---|
ValueError
|
If no voice found |