File size: 744 Bytes
95ab1d7 b7ce2e4 ed51056 990c0ec ed51056 990c0ec ed51056 990c0ec 10f692e 990c0ec |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
import os
import torch
import gradio as gr
from bark import generate_audio, preload_models
from scipy.io.wavfile import write as write_wav
# Load Bark models
preload_models()
def generate(text):
# Inject horror style: creepy pauses, gasping
text = f"[clears throat]{text} [laughs creepily] [breathing heavily]"
audio_array = generate_audio(text)
out_path = "output.wav"
write_wav(out_path, rate=24000, data=audio_array)
return out_path
demo = gr.Interface(
fn=generate,
inputs=gr.Textbox(label="💀 Type something cursed"),
outputs=gr.Audio(type="filepath"),
title="Bark Horror Voice Generator",
description="👹 Type scary text. Get glitchy cursed voice. Powered by Bark AI."
)
demo.launch()
|