Skip to content

Instantly share code, notes, and snippets.

@davidmezzetti
Created November 15, 2025 12:24
Show Gist options
  • Select an option

  • Save davidmezzetti/bda325f4611169d05d753b5c069adddb to your computer and use it in GitHub Desktop.

Select an option

Save davidmezzetti/bda325f4611169d05d753b5c069adddb to your computer and use it in GitHub Desktop.
import soundfile as sf
from txtai.pipeline import TextToAudio
# Create and run pipeline (Note that model is CC-BY-NC)
tta = TextToAudio("facebook/musicgen-stereo-medium")
speech, rate = tta("Happy 80s rock and synth for a fun startup company")
# Write to file
sf.write("out.wav", speech.T, rate)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment