Class: Revox::Resources::Voices
- Inherits:
-
Object
- Object
- Revox::Resources::Voices
- Defined in:
- lib/revox/resources/voices.rb,
sig/revox/resources/voices.rbs
Instance Method Summary collapse
-
#clone_(audio:, content_type:, language:, name:, request_options: {}) ⇒ Revox::Models::VoiceCloneResponse
Clone a voice from an audio recording.
-
#delete(id, request_options: {}) ⇒ Revox::Models::VoiceDeleteResponse
Delete a cloned voice.
-
#initialize(client:) ⇒ Voices
constructor
private
A new instance of Voices.
-
#list(request_options: {}) ⇒ Revox::Models::VoiceListResponse
Retrieve all voices available for AI calls, including preset voices from Cartesia/ElevenLabs and your organization's cloned voices.
-
#preview(provider:, voice_id:, model: nil, speed: nil, text: nil, volume: nil, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::VoicePreviewParams for more details.
-
#retrieve(id, provider:, request_options: {}) ⇒ Revox::Models::VoiceRetrieveResponse
Retrieve details for a single voice by its unique ID and provider.
Constructor Details
#initialize(client:) ⇒ Voices
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Voices.
138 139 140 |
# File 'lib/revox/resources/voices.rb', line 138 def initialize(client:) @client = client end |
Instance Method Details
#clone_(audio:, content_type:, language:, name:, request_options: {}) ⇒ Revox::Models::VoiceCloneResponse
Clone a voice from an audio recording. Send audio as a base64-encoded string. The cloned voice will be available in GET /voices.
89 90 91 92 93 94 95 96 97 98 |
# File 'lib/revox/resources/voices.rb', line 89 def clone_(params) parsed, = Revox::VoiceCloneParams.dump_request(params) @client.request( method: :post, path: "voices/clone", body: parsed, model: Revox::Models::VoiceCloneResponse, options: ) end |
#delete(id, request_options: {}) ⇒ Revox::Models::VoiceDeleteResponse
Delete a cloned voice. Only cloned voices can be deleted. Returns 409 if the voice is in use by an assistant.
62 63 64 65 66 67 68 69 |
# File 'lib/revox/resources/voices.rb', line 62 def delete(id, params = {}) @client.request( method: :delete, path: ["voices/%1$s", id], model: Revox::Models::VoiceDeleteResponse, options: params[:request_options] ) end |
#list(request_options: {}) ⇒ Revox::Models::VoiceListResponse
Retrieve all voices available for AI calls, including preset voices from Cartesia/ElevenLabs and your organization's cloned voices.
41 42 43 44 45 46 47 48 |
# File 'lib/revox/resources/voices.rb', line 41 def list(params = {}) @client.request( method: :get, path: "voices", model: Revox::Models::VoiceListResponse, options: params[:request_options] ) end |
#preview(provider:, voice_id:, model: nil, speed: nil, text: nil, volume: nil, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::VoicePreviewParams for more details.
Generate a short audio preview for a given voice.
124 125 126 127 128 129 130 131 132 133 |
# File 'lib/revox/resources/voices.rb', line 124 def preview(params) parsed, = Revox::VoicePreviewParams.dump_request(params) @client.request( method: :post, path: "voices/preview", body: parsed, model: NilClass, options: ) end |
#retrieve(id, provider:, request_options: {}) ⇒ Revox::Models::VoiceRetrieveResponse
Retrieve details for a single voice by its unique ID and provider.
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/revox/resources/voices.rb', line 19 def retrieve(id, params) parsed, = Revox::VoiceRetrieveParams.dump_request(params) query = Revox::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["voices/%1$s", id], query: query, model: Revox::Models::VoiceRetrieveResponse, options: ) end |