sttp.openai.requests.audio.speech

Members list

Type members

Classlikes

sealed abstract class ResponseFormat(val value: String)

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Aac
class CustomFormat
object Flac
object Mp3
object Opus
object Pcm
object Wav
Show all

Attributes

Companion
class
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed abstract class SpeechModel(val value: String)

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object TTS1
object TTS1HD
object SpeechModel

Attributes

Companion
class
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
case class SpeechRequestBody(model: SpeechModel, input: String, voice: Voice, responseFormat: Option[ResponseFormat], speed: Option[Float])

Represents the request body for generating speech from text.

Represents the request body for generating speech from text.

Value parameters

input

The text to generate audio for. The maximum length is 4096 characters.

model

One of the available TTS models: tts-1 or tts-1-hd.

responseFormat

The format to audio in. Supported formats are mp3, opus, aac, flac, wav, and pcm. Defaults to mp3.

speed

The speed of the generated audio. Select a value from 0.25 to 4.0. 1.0 is the default.

voice

The voice to use when generating the audio. Supported voices are alloy, ash, coral, echo, fable, onyx, nova, sage, and shimmer. Previews of the voices are available in the Text to speech guide https://platform.openai.com/docs/guides/text-to-speech#voice-options.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed abstract class Voice(val value: String)

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Alloy
object Ash
object Coral
class CustomVoice
object Echo
object Fable
object Nova
object Onyx
object Sage
object Shimmer
Show all
object Voice

Attributes

Companion
class
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Voice.type