TGViewer
ИИволюция 👾 ИИволюция 👾 @ai_volution · 11.8K subscribers
Post #1048 3.04K
Еще никогда ранее не было так просто интегрировать такого уровня синтезированную речь в своих проектах.

Вот код на Python с демо текстом и демо инструкцией:

import asyncio

from openai import AsyncOpenAI
from openai.helpers import LocalAudioPlayer

openai = AsyncOpenAI()

input = """Woohoo! Let's get those meetings scheduled, superstar!\n\nAlright, first up—Monday at 10 AM, you've got a check-in with the team. Go, teamwork! Next, we're locking in Wednesday at 2 PM for that client presentation—you got this!\n\nOh, and don't forget Friday at 4 PM, a strategy session to wrap up the week. Finish strong!\n\nNeed to move anything around? No worries—I'm here to keep your schedule totally winning! Just say the word, and I'll make it happen! Let's do this!"""

instructions = """Personality/affect: a high-energy cheerleader helping with administrative tasks \n\nVoice: Enthusiastic, and bubbly, with an uplifting and motivational quality.\n\nTone: Encouraging and playful, making even simple tasks feel exciting and fun.\n\nDialect: Casual and upbeat, using informal phrasing and pep talk-style expressions.\n\nPronunciation: Crisp and lively, with exaggerated emphasis on positive words to keep the energy high.\n\nFeatures: Uses motivational phrases, cheerful exclamations, and an energetic rhythm to create a sense of excitement and engagement."""

async def main() -> None:

async with openai.audio.speech.with_streaming_response.create(
model="gpt-4o-mini-tts",
voice="coral",
input=input,
instructions=instructions,
response_format="pcm",
) as response:
await LocalAudioPlayer().play(response)

if __name__ == "__main__":
asyncio.run(main())


Здесь больше места занимает сам текст озвучки и инструкция, чем сам код!

В потрясающее время мы живём! Создавайте, творите, будьте на вайбе!🍸

ИИволюция
  • 🔥 16
  • 👍 3
More from @ai_volution
  1. Oct 9, 2026Прошел все стадии принятия бана codex/claude аккаунтов. 1. Купил минимальную подписку Lite…
  2. Oct 8, 2026Вы уже собираете AI-агентов, но на реальной задаче приходится заново продумывать требовани…
  3. Oct 7, 2026Сегодня во всех каналах “OpenAI дропнули 722 пейпера по математике” А мы с женой, по больш…
  4. Oct 7, 2026OpenAI упростили понятие тиров на платформе для компаний. Было 5 тиров с разными лимитами,…
  5. Oct 7, 2026“AI заменит людей в службе поддержки” – говорили они. Но почему-то у OpenAI служба поддерж…
  6. Oct 6, 2026“at this time” или как мягко послать куда подальше 🤡
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →