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 September 13, 2024 09:00
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 '