Skip to content

Instantly share code, notes, and snippets.

View moha-abdi's full-sized avatar
:octocat:
Working from home….

Moha Abdi moha-abdi

:octocat:
Working from home….
View GitHub Profile
@moha-abdi
moha-abdi / tts_with_pauses.py
Last active February 18, 2025 18:18
Subclass for edge_tts.Communicate but it generates the TTS with pauses as the custom SSML is not working anymore.
import asyncio
from typing import Union, Optional
from pydub import AudioSegment
import io
from edge_tts import Communicate
class NoPausesFound(Exception):
def __init__(self, description = None) -> None:
self.description = (f'No pauses were found in the text. Please '