Class: ElevenlabsClient::ForcedAlignment
- Inherits:
-
Object
- Object
- ElevenlabsClient::ForcedAlignment
- Defined in:
- lib/elevenlabs_client/endpoints/forced_alignment.rb
Instance Method Summary collapse
-
#create(audio_file, filename, text, **options) ⇒ Hash
(also: #align, #force_align)
POST /v1/forced-alignment Force align an audio file to text.
-
#initialize(client) ⇒ ForcedAlignment
constructor
A new instance of ForcedAlignment.
Constructor Details
#initialize(client) ⇒ ForcedAlignment
Returns a new instance of ForcedAlignment.
5 6 7 |
# File 'lib/elevenlabs_client/endpoints/forced_alignment.rb', line 5 def initialize(client) @client = client end |
Instance Method Details
#create(audio_file, filename, text, **options) ⇒ Hash Also known as: align, force_align
POST /v1/forced-alignment Force align an audio file to text. Get timing information for each character and word Documentation: https://elevenlabs.io/docs/api-reference/forced-alignment
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/elevenlabs_client/endpoints/forced_alignment.rb', line 19 def create(audio_file, filename, text, **) endpoint = "/v1/forced-alignment" payload = { file: @client.file_part(audio_file, filename), text: text } # Add optional parameters if provided payload[:enabled_spooled_file] = [:enabled_spooled_file] unless [:enabled_spooled_file].nil? @client.post_multipart(endpoint, payload) end |