Skip to content

Instantly share code, notes, and snippets.

View moha-abdi's full-sized avatar
🏠
Working from home

Moha Abdi moha-abdi

🏠
Working from home
View GitHub Profile
@moha-abdi
moha-abdi / tts_with_pauses.py
Last active March 4, 2024 09:12
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 '