class

Arcana::AI::TTS::OpenAI

Inherits Arcana::AI::TTS::Provider < Arcana::AI::Traceable < Reference < Object

Constants

DEFAULT_MODEL = "gpt-4o-mini-tts"
DEFAULT_VOICE = "alloy"
ENDPOINT = "https://api.openai.com/v1/audio/speech"

Constructors

new(api_key : String, model : String = DEFAULT_MODEL, voice : String = DEFAULT_VOICE, endpoint : String = ENDPOINT, trace : Proc(String, Nil) | Nil = nil)
Source

Instance methods

model
Source
name
Source
stream(request : Request, ctx : Context | Nil = nil, &block : Bytes -> ) : Result

Stream audio chunks as they arrive. Override in subclasses.

Source
synthesize(request : Request) : Result

Synthesize speech in memory. The audio is in Result#audio; Result#output_path is empty.

Source