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
-
#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.
88 89 90 |
# File 'lib/revox/resources/voices.rb', line 88 def initialize(client:) @client = client end |
Instance Method Details
#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.
74 75 76 77 78 79 80 81 82 83 |
# File 'lib/revox/resources/voices.rb', line 74 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 |