telnyx 5.43.0 → 5.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -0
- data/README.md +1 -1
- data/lib/telnyx/models/conferences/action_record_start_params.rb +22 -1
- data/lib/telnyx/models/text_to_speech_stream_params.rb +111 -0
- data/lib/telnyx/models.rb +2 -2
- data/lib/telnyx/resources/conferences/actions.rb +3 -1
- data/lib/telnyx/resources/text_to_speech.rb +54 -27
- data/lib/telnyx/version.rb +1 -1
- data/lib/telnyx.rb +1 -1
- data/rbi/telnyx/models/conferences/action_record_start_params.rbi +62 -0
- data/rbi/telnyx/models/text_to_speech_stream_params.rbi +231 -0
- data/rbi/telnyx/models.rbi +2 -3
- data/rbi/telnyx/resources/conferences/actions.rbi +5 -0
- data/rbi/telnyx/resources/text_to_speech.rbi +59 -28
- data/sig/telnyx/models/conferences/action_record_start_params.rbs +20 -0
- data/sig/telnyx/models/text_to_speech_stream_params.rbs +110 -0
- data/sig/telnyx/models.rbs +2 -2
- data/sig/telnyx/resources/conferences/actions.rbs +1 -0
- data/sig/telnyx/resources/text_to_speech.rbs +11 -6
- metadata +5 -5
- data/lib/telnyx/models/text_to_speech_generate_speech_params.rb +0 -43
- data/rbi/telnyx/models/text_to_speech_generate_speech_params.rbi +0 -74
- data/sig/telnyx/models/text_to_speech_generate_speech_params.rbs +0 -28
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9c0be82d7774523b4c36a553d0d466572d8ef7e5979e0f5853cfb8f6f5297c28
|
|
4
|
+
data.tar.gz: 782dd17b2bbc69f7dc29f8205ca60ae39b0f4216ce4d09e67fe124672d936388
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c4c55c4c65b89afa345066bc1d88e668ef3138770fd2d5e038d37864123684ecf8398045bf5ccc5af4f35a12e6984f84e0e4653b598935d987669f5b26544511
|
|
7
|
+
data.tar.gz: 452fc9facf1492903a8484e3eb6caafa0ce32eb1736ae16c2cd93e5ee36918360dd141c24d240e231c106e9a910cf768158ed16fbb3536fa63782dce2bd96591
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 5.45.0 (2026-02-26)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v5.44.0...v5.45.0](https://github.com/team-telnyx/telnyx-ruby/compare/v5.44.0...v5.45.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* TELAPPS-ENGDESK-48951 add channels to conf record start ([f6e45ec](https://github.com/team-telnyx/telnyx-ruby/commit/f6e45eca1aeab1f2db9c096f42714790049c823b))
|
|
10
|
+
|
|
11
|
+
## 5.44.0 (2026-02-26)
|
|
12
|
+
|
|
13
|
+
Full Changelog: [v5.43.0...v5.44.0](https://github.com/team-telnyx/telnyx-ruby/compare/v5.43.0...v5.44.0)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* Add text-to-speech WebSocket streaming OpenAPI spec ([c6c082b](https://github.com/team-telnyx/telnyx-ruby/commit/c6c082b8a0d47d63c136f7c81e5bd4eceffb2872))
|
|
18
|
+
* **api:** manual updates ([d834462](https://github.com/team-telnyx/telnyx-ruby/commit/d834462641d4d929399bf7dbdef9e1bac6dcde8a))
|
|
19
|
+
|
|
3
20
|
## 5.43.0 (2026-02-25)
|
|
4
21
|
|
|
5
22
|
Full Changelog: [v5.42.0...v5.43.0](https://github.com/team-telnyx/telnyx-ruby/compare/v5.42.0...v5.43.0)
|
data/README.md
CHANGED
|
@@ -19,6 +19,13 @@ module Telnyx
|
|
|
19
19
|
},
|
|
20
20
|
api_name: :format
|
|
21
21
|
|
|
22
|
+
# @!attribute channels
|
|
23
|
+
# When `dual`, final audio file will be stereo recorded with the conference
|
|
24
|
+
# creator on the first channel, and the rest on the second channel.
|
|
25
|
+
#
|
|
26
|
+
# @return [Symbol, Telnyx::Models::Conferences::ActionRecordStartParams::Channels, nil]
|
|
27
|
+
optional :channels, enum: -> { Telnyx::Conferences::ActionRecordStartParams::Channels }
|
|
28
|
+
|
|
22
29
|
# @!attribute command_id
|
|
23
30
|
# Use this field to avoid duplicate commands. Telnyx will ignore any command with
|
|
24
31
|
# the same `command_id` for the same `conference_id`.
|
|
@@ -53,12 +60,14 @@ module Telnyx
|
|
|
53
60
|
# @return [Symbol, Telnyx::Models::Conferences::ActionRecordStartParams::Trim, nil]
|
|
54
61
|
optional :trim, enum: -> { Telnyx::Conferences::ActionRecordStartParams::Trim }
|
|
55
62
|
|
|
56
|
-
# @!method initialize(format_:, command_id: nil, custom_file_name: nil, play_beep: nil, region: nil, trim: nil, request_options: {})
|
|
63
|
+
# @!method initialize(format_:, channels: nil, command_id: nil, custom_file_name: nil, play_beep: nil, region: nil, trim: nil, request_options: {})
|
|
57
64
|
# Some parameter documentations has been truncated, see
|
|
58
65
|
# {Telnyx::Models::Conferences::ActionRecordStartParams} for more details.
|
|
59
66
|
#
|
|
60
67
|
# @param format_ [Symbol, Telnyx::Models::Conferences::ActionRecordStartParams::Format] The audio file format used when storing the conference recording. Can be either
|
|
61
68
|
#
|
|
69
|
+
# @param channels [Symbol, Telnyx::Models::Conferences::ActionRecordStartParams::Channels] When `dual`, final audio file will be stereo recorded with the conference creato
|
|
70
|
+
#
|
|
62
71
|
# @param command_id [String] Use this field to avoid duplicate commands. Telnyx will ignore any command with
|
|
63
72
|
#
|
|
64
73
|
# @param custom_file_name [String] The custom recording file name to be used instead of the default `call_leg_id`.
|
|
@@ -83,6 +92,18 @@ module Telnyx
|
|
|
83
92
|
# @return [Array<Symbol>]
|
|
84
93
|
end
|
|
85
94
|
|
|
95
|
+
# When `dual`, final audio file will be stereo recorded with the conference
|
|
96
|
+
# creator on the first channel, and the rest on the second channel.
|
|
97
|
+
module Channels
|
|
98
|
+
extend Telnyx::Internal::Type::Enum
|
|
99
|
+
|
|
100
|
+
SINGLE = :single
|
|
101
|
+
DUAL = :dual
|
|
102
|
+
|
|
103
|
+
# @!method self.values
|
|
104
|
+
# @return [Array<Symbol>]
|
|
105
|
+
end
|
|
106
|
+
|
|
86
107
|
# Region where the conference data is located. Defaults to the region defined in
|
|
87
108
|
# user's data locality settings (Europe or US).
|
|
88
109
|
module Region
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
module Models
|
|
5
|
+
# @see Telnyx::Resources::TextToSpeech#stream
|
|
6
|
+
class TextToSpeechStreamParams < Telnyx::Internal::Type::BaseModel
|
|
7
|
+
extend Telnyx::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Telnyx::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute audio_format
|
|
11
|
+
# Audio output format override. Supported for Telnyx `Natural`/`NaturalHD` models
|
|
12
|
+
# only. Accepted values: `pcm`, `wav`.
|
|
13
|
+
#
|
|
14
|
+
# @return [Symbol, Telnyx::Models::TextToSpeechStreamParams::AudioFormat, nil]
|
|
15
|
+
optional :audio_format, enum: -> { Telnyx::TextToSpeechStreamParams::AudioFormat }
|
|
16
|
+
|
|
17
|
+
# @!attribute disable_cache
|
|
18
|
+
# When `true`, bypass the audio cache and generate fresh audio.
|
|
19
|
+
#
|
|
20
|
+
# @return [Boolean, nil]
|
|
21
|
+
optional :disable_cache, Telnyx::Internal::Type::Boolean
|
|
22
|
+
|
|
23
|
+
# @!attribute model_id
|
|
24
|
+
# Model identifier for the chosen provider. Examples: `Natural`, `NaturalHD`
|
|
25
|
+
# (Telnyx); `Polly.Generative` (AWS).
|
|
26
|
+
#
|
|
27
|
+
# @return [String, nil]
|
|
28
|
+
optional :model_id, String
|
|
29
|
+
|
|
30
|
+
# @!attribute provider
|
|
31
|
+
# TTS provider. Defaults to `telnyx` if not specified. Ignored when `voice` is
|
|
32
|
+
# provided.
|
|
33
|
+
#
|
|
34
|
+
# @return [Symbol, Telnyx::Models::TextToSpeechStreamParams::Provider, nil]
|
|
35
|
+
optional :provider, enum: -> { Telnyx::TextToSpeechStreamParams::Provider }
|
|
36
|
+
|
|
37
|
+
# @!attribute socket_id
|
|
38
|
+
# Client-provided socket identifier for tracking. If not provided, one is
|
|
39
|
+
# generated server-side.
|
|
40
|
+
#
|
|
41
|
+
# @return [String, nil]
|
|
42
|
+
optional :socket_id, String
|
|
43
|
+
|
|
44
|
+
# @!attribute voice
|
|
45
|
+
# Voice identifier in the format `provider.model_id.voice_id` or
|
|
46
|
+
# `provider.voice_id` (e.g. `telnyx.NaturalHD.Telnyx_Alloy` or
|
|
47
|
+
# `azure.en-US-AvaMultilingualNeural`). When provided, the `provider`, `model_id`,
|
|
48
|
+
# and `voice_id` are extracted automatically. Takes precedence over individual
|
|
49
|
+
# `provider`/`model_id`/`voice_id` parameters.
|
|
50
|
+
#
|
|
51
|
+
# @return [String, nil]
|
|
52
|
+
optional :voice, String
|
|
53
|
+
|
|
54
|
+
# @!attribute voice_id
|
|
55
|
+
# Voice identifier for the chosen provider.
|
|
56
|
+
#
|
|
57
|
+
# @return [String, nil]
|
|
58
|
+
optional :voice_id, String
|
|
59
|
+
|
|
60
|
+
# @!method initialize(audio_format: nil, disable_cache: nil, model_id: nil, provider: nil, socket_id: nil, voice: nil, voice_id: nil, request_options: {})
|
|
61
|
+
# Some parameter documentations has been truncated, see
|
|
62
|
+
# {Telnyx::Models::TextToSpeechStreamParams} for more details.
|
|
63
|
+
#
|
|
64
|
+
# @param audio_format [Symbol, Telnyx::Models::TextToSpeechStreamParams::AudioFormat] Audio output format override. Supported for Telnyx `Natural`/`NaturalHD` models
|
|
65
|
+
#
|
|
66
|
+
# @param disable_cache [Boolean] When `true`, bypass the audio cache and generate fresh audio.
|
|
67
|
+
#
|
|
68
|
+
# @param model_id [String] Model identifier for the chosen provider. Examples: `Natural`, `NaturalHD` (Teln
|
|
69
|
+
#
|
|
70
|
+
# @param provider [Symbol, Telnyx::Models::TextToSpeechStreamParams::Provider] TTS provider. Defaults to `telnyx` if not specified. Ignored when `voice` is pro
|
|
71
|
+
#
|
|
72
|
+
# @param socket_id [String] Client-provided socket identifier for tracking. If not provided, one is generate
|
|
73
|
+
#
|
|
74
|
+
# @param voice [String] Voice identifier in the format `provider.model_id.voice_id` or `provider.voice_i
|
|
75
|
+
#
|
|
76
|
+
# @param voice_id [String] Voice identifier for the chosen provider.
|
|
77
|
+
#
|
|
78
|
+
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}]
|
|
79
|
+
|
|
80
|
+
# Audio output format override. Supported for Telnyx `Natural`/`NaturalHD` models
|
|
81
|
+
# only. Accepted values: `pcm`, `wav`.
|
|
82
|
+
module AudioFormat
|
|
83
|
+
extend Telnyx::Internal::Type::Enum
|
|
84
|
+
|
|
85
|
+
PCM = :pcm
|
|
86
|
+
WAV = :wav
|
|
87
|
+
|
|
88
|
+
# @!method self.values
|
|
89
|
+
# @return [Array<Symbol>]
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# TTS provider. Defaults to `telnyx` if not specified. Ignored when `voice` is
|
|
93
|
+
# provided.
|
|
94
|
+
module Provider
|
|
95
|
+
extend Telnyx::Internal::Type::Enum
|
|
96
|
+
|
|
97
|
+
AWS = :aws
|
|
98
|
+
TELNYX = :telnyx
|
|
99
|
+
AZURE = :azure
|
|
100
|
+
ELEVENLABS = :elevenlabs
|
|
101
|
+
MINIMAX = :minimax
|
|
102
|
+
MURFAI = :murfai
|
|
103
|
+
RIME = :rime
|
|
104
|
+
RESEMBLE = :resemble
|
|
105
|
+
|
|
106
|
+
# @!method self.values
|
|
107
|
+
# @return [Array<Symbol>]
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
end
|
data/lib/telnyx/models.rb
CHANGED
|
@@ -1488,10 +1488,10 @@ module Telnyx
|
|
|
1488
1488
|
|
|
1489
1489
|
TexmlSecretsParams = Telnyx::Models::TexmlSecretsParams
|
|
1490
1490
|
|
|
1491
|
-
TextToSpeechGenerateSpeechParams = Telnyx::Models::TextToSpeechGenerateSpeechParams
|
|
1492
|
-
|
|
1493
1491
|
TextToSpeechListVoicesParams = Telnyx::Models::TextToSpeechListVoicesParams
|
|
1494
1492
|
|
|
1493
|
+
TextToSpeechStreamParams = Telnyx::Models::TextToSpeechStreamParams
|
|
1494
|
+
|
|
1495
1495
|
TrafficType = Telnyx::Models::TrafficType
|
|
1496
1496
|
|
|
1497
1497
|
Transcription = Telnyx::Models::Transcription
|
|
@@ -391,12 +391,14 @@ module Telnyx
|
|
|
391
391
|
#
|
|
392
392
|
# - `conference.recording.saved`
|
|
393
393
|
#
|
|
394
|
-
# @overload record_start(id, format_:, command_id: nil, custom_file_name: nil, play_beep: nil, region: nil, trim: nil, request_options: {})
|
|
394
|
+
# @overload record_start(id, format_:, channels: nil, command_id: nil, custom_file_name: nil, play_beep: nil, region: nil, trim: nil, request_options: {})
|
|
395
395
|
#
|
|
396
396
|
# @param id [String] Specifies the conference to record by id or name
|
|
397
397
|
#
|
|
398
398
|
# @param format_ [Symbol, Telnyx::Models::Conferences::ActionRecordStartParams::Format] The audio file format used when storing the conference recording. Can be either
|
|
399
399
|
#
|
|
400
|
+
# @param channels [Symbol, Telnyx::Models::Conferences::ActionRecordStartParams::Channels] When `dual`, final audio file will be stereo recorded with the conference creato
|
|
401
|
+
#
|
|
400
402
|
# @param command_id [String] Use this field to avoid duplicate commands. Telnyx will ignore any command with
|
|
401
403
|
#
|
|
402
404
|
# @param custom_file_name [String] The custom recording file name to be used instead of the default `call_leg_id`.
|
|
@@ -3,55 +3,82 @@
|
|
|
3
3
|
module Telnyx
|
|
4
4
|
module Resources
|
|
5
5
|
class TextToSpeech
|
|
6
|
-
#
|
|
7
|
-
# {Telnyx::Models::TextToSpeechGenerateSpeechParams} for more details.
|
|
8
|
-
#
|
|
9
|
-
# Converts the provided text to speech using the specified voice and returns audio
|
|
10
|
-
# data
|
|
6
|
+
# Returns a list of voices that can be used with the text to speech commands.
|
|
11
7
|
#
|
|
12
|
-
# @overload
|
|
8
|
+
# @overload list_voices(elevenlabs_api_key_ref: nil, provider: nil, request_options: {})
|
|
13
9
|
#
|
|
14
|
-
# @param
|
|
10
|
+
# @param elevenlabs_api_key_ref [String] Reference to your ElevenLabs API key stored in the Telnyx Portal
|
|
15
11
|
#
|
|
16
|
-
# @param
|
|
12
|
+
# @param provider [Symbol, Telnyx::Models::TextToSpeechListVoicesParams::Provider] Filter voices by provider
|
|
17
13
|
#
|
|
18
14
|
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
19
15
|
#
|
|
20
|
-
# @return [
|
|
16
|
+
# @return [Telnyx::Models::TextToSpeechListVoicesResponse]
|
|
21
17
|
#
|
|
22
|
-
# @see Telnyx::Models::
|
|
23
|
-
def
|
|
24
|
-
parsed, options = Telnyx::
|
|
18
|
+
# @see Telnyx::Models::TextToSpeechListVoicesParams
|
|
19
|
+
def list_voices(params = {})
|
|
20
|
+
parsed, options = Telnyx::TextToSpeechListVoicesParams.dump_request(params)
|
|
25
21
|
@client.request(
|
|
26
|
-
method: :
|
|
27
|
-
path: "text-to-speech/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
model: StringIO,
|
|
22
|
+
method: :get,
|
|
23
|
+
path: "text-to-speech/voices",
|
|
24
|
+
query: parsed,
|
|
25
|
+
model: Telnyx::Models::TextToSpeechListVoicesResponse,
|
|
31
26
|
options: options
|
|
32
27
|
)
|
|
33
28
|
end
|
|
34
29
|
|
|
35
|
-
#
|
|
30
|
+
# Some parameter documentations has been truncated, see
|
|
31
|
+
# {Telnyx::Models::TextToSpeechStreamParams} for more details.
|
|
36
32
|
#
|
|
37
|
-
#
|
|
33
|
+
# Open a WebSocket connection to stream text and receive synthesized audio in real
|
|
34
|
+
# time. Authentication is provided via the standard
|
|
35
|
+
# `Authorization: Bearer <API_KEY>` header. Send JSON frames with text to
|
|
36
|
+
# synthesize; receive JSON frames containing base64-encoded audio chunks.
|
|
38
37
|
#
|
|
39
|
-
#
|
|
38
|
+
# Supported providers: `aws`, `telnyx`, `azure`, `murfai`, `minimax`, `rime`,
|
|
39
|
+
# `resemble`, `elevenlabs`.
|
|
40
40
|
#
|
|
41
|
-
#
|
|
41
|
+
# **Connection flow:**
|
|
42
|
+
#
|
|
43
|
+
# 1. Open WebSocket with query parameters specifying provider, voice, and model.
|
|
44
|
+
# 2. Send an initial handshake message `{"text": " "}` (single space) with
|
|
45
|
+
# optional `voice_settings` to initialize the session.
|
|
46
|
+
# 3. Send text messages as `{"text": "Hello world"}`.
|
|
47
|
+
# 4. Receive audio chunks as JSON frames with base64-encoded audio.
|
|
48
|
+
# 5. A final frame with `isFinal: true` indicates the end of audio for the current
|
|
49
|
+
# text.
|
|
50
|
+
#
|
|
51
|
+
# To interrupt and restart synthesis mid-stream, send `{"force": true}` — the
|
|
52
|
+
# current worker is stopped and a new one is started.
|
|
53
|
+
#
|
|
54
|
+
# @overload stream(audio_format: nil, disable_cache: nil, model_id: nil, provider: nil, socket_id: nil, voice: nil, voice_id: nil, request_options: {})
|
|
55
|
+
#
|
|
56
|
+
# @param audio_format [Symbol, Telnyx::Models::TextToSpeechStreamParams::AudioFormat] Audio output format override. Supported for Telnyx `Natural`/`NaturalHD` models
|
|
57
|
+
#
|
|
58
|
+
# @param disable_cache [Boolean] When `true`, bypass the audio cache and generate fresh audio.
|
|
59
|
+
#
|
|
60
|
+
# @param model_id [String] Model identifier for the chosen provider. Examples: `Natural`, `NaturalHD` (Teln
|
|
61
|
+
#
|
|
62
|
+
# @param provider [Symbol, Telnyx::Models::TextToSpeechStreamParams::Provider] TTS provider. Defaults to `telnyx` if not specified. Ignored when `voice` is pro
|
|
63
|
+
#
|
|
64
|
+
# @param socket_id [String] Client-provided socket identifier for tracking. If not provided, one is generate
|
|
65
|
+
#
|
|
66
|
+
# @param voice [String] Voice identifier in the format `provider.model_id.voice_id` or `provider.voice_i
|
|
67
|
+
#
|
|
68
|
+
# @param voice_id [String] Voice identifier for the chosen provider.
|
|
42
69
|
#
|
|
43
70
|
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
44
71
|
#
|
|
45
|
-
# @return [
|
|
72
|
+
# @return [nil]
|
|
46
73
|
#
|
|
47
|
-
# @see Telnyx::Models::
|
|
48
|
-
def
|
|
49
|
-
parsed, options = Telnyx::
|
|
74
|
+
# @see Telnyx::Models::TextToSpeechStreamParams
|
|
75
|
+
def stream(params = {})
|
|
76
|
+
parsed, options = Telnyx::TextToSpeechStreamParams.dump_request(params)
|
|
50
77
|
@client.request(
|
|
51
78
|
method: :get,
|
|
52
|
-
path: "text-to-speech/
|
|
79
|
+
path: "text-to-speech/speech",
|
|
53
80
|
query: parsed,
|
|
54
|
-
model:
|
|
81
|
+
model: NilClass,
|
|
55
82
|
options: options
|
|
56
83
|
)
|
|
57
84
|
end
|
data/lib/telnyx/version.rb
CHANGED
data/lib/telnyx.rb
CHANGED
|
@@ -2036,9 +2036,9 @@ require_relative "telnyx/models/texml_application_update_params"
|
|
|
2036
2036
|
require_relative "telnyx/models/texml_application_update_response"
|
|
2037
2037
|
require_relative "telnyx/models/texml_secrets_params"
|
|
2038
2038
|
require_relative "telnyx/models/texml_secrets_response"
|
|
2039
|
-
require_relative "telnyx/models/text_to_speech_generate_speech_params"
|
|
2040
2039
|
require_relative "telnyx/models/text_to_speech_list_voices_params"
|
|
2041
2040
|
require_relative "telnyx/models/text_to_speech_list_voices_response"
|
|
2041
|
+
require_relative "telnyx/models/text_to_speech_stream_params"
|
|
2042
2042
|
require_relative "telnyx/models/traffic_type"
|
|
2043
2043
|
require_relative "telnyx/models/transcription"
|
|
2044
2044
|
require_relative "telnyx/models/transcription_webhook_event"
|
|
@@ -24,6 +24,25 @@ module Telnyx
|
|
|
24
24
|
end
|
|
25
25
|
attr_accessor :format_
|
|
26
26
|
|
|
27
|
+
# When `dual`, final audio file will be stereo recorded with the conference
|
|
28
|
+
# creator on the first channel, and the rest on the second channel.
|
|
29
|
+
sig do
|
|
30
|
+
returns(
|
|
31
|
+
T.nilable(
|
|
32
|
+
Telnyx::Conferences::ActionRecordStartParams::Channels::OrSymbol
|
|
33
|
+
)
|
|
34
|
+
)
|
|
35
|
+
end
|
|
36
|
+
attr_reader :channels
|
|
37
|
+
|
|
38
|
+
sig do
|
|
39
|
+
params(
|
|
40
|
+
channels:
|
|
41
|
+
Telnyx::Conferences::ActionRecordStartParams::Channels::OrSymbol
|
|
42
|
+
).void
|
|
43
|
+
end
|
|
44
|
+
attr_writer :channels
|
|
45
|
+
|
|
27
46
|
# Use this field to avoid duplicate commands. Telnyx will ignore any command with
|
|
28
47
|
# the same `command_id` for the same `conference_id`.
|
|
29
48
|
sig { returns(T.nilable(String)) }
|
|
@@ -88,6 +107,8 @@ module Telnyx
|
|
|
88
107
|
params(
|
|
89
108
|
format_:
|
|
90
109
|
Telnyx::Conferences::ActionRecordStartParams::Format::OrSymbol,
|
|
110
|
+
channels:
|
|
111
|
+
Telnyx::Conferences::ActionRecordStartParams::Channels::OrSymbol,
|
|
91
112
|
command_id: String,
|
|
92
113
|
custom_file_name: String,
|
|
93
114
|
play_beep: T::Boolean,
|
|
@@ -101,6 +122,9 @@ module Telnyx
|
|
|
101
122
|
# The audio file format used when storing the conference recording. Can be either
|
|
102
123
|
# `mp3` or `wav`.
|
|
103
124
|
format_:,
|
|
125
|
+
# When `dual`, final audio file will be stereo recorded with the conference
|
|
126
|
+
# creator on the first channel, and the rest on the second channel.
|
|
127
|
+
channels: nil,
|
|
104
128
|
# Use this field to avoid duplicate commands. Telnyx will ignore any command with
|
|
105
129
|
# the same `command_id` for the same `conference_id`.
|
|
106
130
|
command_id: nil,
|
|
@@ -124,6 +148,8 @@ module Telnyx
|
|
|
124
148
|
{
|
|
125
149
|
format_:
|
|
126
150
|
Telnyx::Conferences::ActionRecordStartParams::Format::OrSymbol,
|
|
151
|
+
channels:
|
|
152
|
+
Telnyx::Conferences::ActionRecordStartParams::Channels::OrSymbol,
|
|
127
153
|
command_id: String,
|
|
128
154
|
custom_file_name: String,
|
|
129
155
|
play_beep: T::Boolean,
|
|
@@ -174,6 +200,42 @@ module Telnyx
|
|
|
174
200
|
end
|
|
175
201
|
end
|
|
176
202
|
|
|
203
|
+
# When `dual`, final audio file will be stereo recorded with the conference
|
|
204
|
+
# creator on the first channel, and the rest on the second channel.
|
|
205
|
+
module Channels
|
|
206
|
+
extend Telnyx::Internal::Type::Enum
|
|
207
|
+
|
|
208
|
+
TaggedSymbol =
|
|
209
|
+
T.type_alias do
|
|
210
|
+
T.all(
|
|
211
|
+
Symbol,
|
|
212
|
+
Telnyx::Conferences::ActionRecordStartParams::Channels
|
|
213
|
+
)
|
|
214
|
+
end
|
|
215
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
216
|
+
|
|
217
|
+
SINGLE =
|
|
218
|
+
T.let(
|
|
219
|
+
:single,
|
|
220
|
+
Telnyx::Conferences::ActionRecordStartParams::Channels::TaggedSymbol
|
|
221
|
+
)
|
|
222
|
+
DUAL =
|
|
223
|
+
T.let(
|
|
224
|
+
:dual,
|
|
225
|
+
Telnyx::Conferences::ActionRecordStartParams::Channels::TaggedSymbol
|
|
226
|
+
)
|
|
227
|
+
|
|
228
|
+
sig do
|
|
229
|
+
override.returns(
|
|
230
|
+
T::Array[
|
|
231
|
+
Telnyx::Conferences::ActionRecordStartParams::Channels::TaggedSymbol
|
|
232
|
+
]
|
|
233
|
+
)
|
|
234
|
+
end
|
|
235
|
+
def self.values
|
|
236
|
+
end
|
|
237
|
+
end
|
|
238
|
+
|
|
177
239
|
# Region where the conference data is located. Defaults to the region defined in
|
|
178
240
|
# user's data locality settings (Europe or US).
|
|
179
241
|
module Region
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
module Models
|
|
5
|
+
class TextToSpeechStreamParams < Telnyx::Internal::Type::BaseModel
|
|
6
|
+
extend Telnyx::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Telnyx::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(Telnyx::TextToSpeechStreamParams, Telnyx::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Audio output format override. Supported for Telnyx `Natural`/`NaturalHD` models
|
|
15
|
+
# only. Accepted values: `pcm`, `wav`.
|
|
16
|
+
sig do
|
|
17
|
+
returns(
|
|
18
|
+
T.nilable(Telnyx::TextToSpeechStreamParams::AudioFormat::OrSymbol)
|
|
19
|
+
)
|
|
20
|
+
end
|
|
21
|
+
attr_reader :audio_format
|
|
22
|
+
|
|
23
|
+
sig do
|
|
24
|
+
params(
|
|
25
|
+
audio_format: Telnyx::TextToSpeechStreamParams::AudioFormat::OrSymbol
|
|
26
|
+
).void
|
|
27
|
+
end
|
|
28
|
+
attr_writer :audio_format
|
|
29
|
+
|
|
30
|
+
# When `true`, bypass the audio cache and generate fresh audio.
|
|
31
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
32
|
+
attr_reader :disable_cache
|
|
33
|
+
|
|
34
|
+
sig { params(disable_cache: T::Boolean).void }
|
|
35
|
+
attr_writer :disable_cache
|
|
36
|
+
|
|
37
|
+
# Model identifier for the chosen provider. Examples: `Natural`, `NaturalHD`
|
|
38
|
+
# (Telnyx); `Polly.Generative` (AWS).
|
|
39
|
+
sig { returns(T.nilable(String)) }
|
|
40
|
+
attr_reader :model_id
|
|
41
|
+
|
|
42
|
+
sig { params(model_id: String).void }
|
|
43
|
+
attr_writer :model_id
|
|
44
|
+
|
|
45
|
+
# TTS provider. Defaults to `telnyx` if not specified. Ignored when `voice` is
|
|
46
|
+
# provided.
|
|
47
|
+
sig do
|
|
48
|
+
returns(T.nilable(Telnyx::TextToSpeechStreamParams::Provider::OrSymbol))
|
|
49
|
+
end
|
|
50
|
+
attr_reader :provider
|
|
51
|
+
|
|
52
|
+
sig do
|
|
53
|
+
params(
|
|
54
|
+
provider: Telnyx::TextToSpeechStreamParams::Provider::OrSymbol
|
|
55
|
+
).void
|
|
56
|
+
end
|
|
57
|
+
attr_writer :provider
|
|
58
|
+
|
|
59
|
+
# Client-provided socket identifier for tracking. If not provided, one is
|
|
60
|
+
# generated server-side.
|
|
61
|
+
sig { returns(T.nilable(String)) }
|
|
62
|
+
attr_reader :socket_id
|
|
63
|
+
|
|
64
|
+
sig { params(socket_id: String).void }
|
|
65
|
+
attr_writer :socket_id
|
|
66
|
+
|
|
67
|
+
# Voice identifier in the format `provider.model_id.voice_id` or
|
|
68
|
+
# `provider.voice_id` (e.g. `telnyx.NaturalHD.Telnyx_Alloy` or
|
|
69
|
+
# `azure.en-US-AvaMultilingualNeural`). When provided, the `provider`, `model_id`,
|
|
70
|
+
# and `voice_id` are extracted automatically. Takes precedence over individual
|
|
71
|
+
# `provider`/`model_id`/`voice_id` parameters.
|
|
72
|
+
sig { returns(T.nilable(String)) }
|
|
73
|
+
attr_reader :voice
|
|
74
|
+
|
|
75
|
+
sig { params(voice: String).void }
|
|
76
|
+
attr_writer :voice
|
|
77
|
+
|
|
78
|
+
# Voice identifier for the chosen provider.
|
|
79
|
+
sig { returns(T.nilable(String)) }
|
|
80
|
+
attr_reader :voice_id
|
|
81
|
+
|
|
82
|
+
sig { params(voice_id: String).void }
|
|
83
|
+
attr_writer :voice_id
|
|
84
|
+
|
|
85
|
+
sig do
|
|
86
|
+
params(
|
|
87
|
+
audio_format: Telnyx::TextToSpeechStreamParams::AudioFormat::OrSymbol,
|
|
88
|
+
disable_cache: T::Boolean,
|
|
89
|
+
model_id: String,
|
|
90
|
+
provider: Telnyx::TextToSpeechStreamParams::Provider::OrSymbol,
|
|
91
|
+
socket_id: String,
|
|
92
|
+
voice: String,
|
|
93
|
+
voice_id: String,
|
|
94
|
+
request_options: Telnyx::RequestOptions::OrHash
|
|
95
|
+
).returns(T.attached_class)
|
|
96
|
+
end
|
|
97
|
+
def self.new(
|
|
98
|
+
# Audio output format override. Supported for Telnyx `Natural`/`NaturalHD` models
|
|
99
|
+
# only. Accepted values: `pcm`, `wav`.
|
|
100
|
+
audio_format: nil,
|
|
101
|
+
# When `true`, bypass the audio cache and generate fresh audio.
|
|
102
|
+
disable_cache: nil,
|
|
103
|
+
# Model identifier for the chosen provider. Examples: `Natural`, `NaturalHD`
|
|
104
|
+
# (Telnyx); `Polly.Generative` (AWS).
|
|
105
|
+
model_id: nil,
|
|
106
|
+
# TTS provider. Defaults to `telnyx` if not specified. Ignored when `voice` is
|
|
107
|
+
# provided.
|
|
108
|
+
provider: nil,
|
|
109
|
+
# Client-provided socket identifier for tracking. If not provided, one is
|
|
110
|
+
# generated server-side.
|
|
111
|
+
socket_id: nil,
|
|
112
|
+
# Voice identifier in the format `provider.model_id.voice_id` or
|
|
113
|
+
# `provider.voice_id` (e.g. `telnyx.NaturalHD.Telnyx_Alloy` or
|
|
114
|
+
# `azure.en-US-AvaMultilingualNeural`). When provided, the `provider`, `model_id`,
|
|
115
|
+
# and `voice_id` are extracted automatically. Takes precedence over individual
|
|
116
|
+
# `provider`/`model_id`/`voice_id` parameters.
|
|
117
|
+
voice: nil,
|
|
118
|
+
# Voice identifier for the chosen provider.
|
|
119
|
+
voice_id: nil,
|
|
120
|
+
request_options: {}
|
|
121
|
+
)
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
sig do
|
|
125
|
+
override.returns(
|
|
126
|
+
{
|
|
127
|
+
audio_format:
|
|
128
|
+
Telnyx::TextToSpeechStreamParams::AudioFormat::OrSymbol,
|
|
129
|
+
disable_cache: T::Boolean,
|
|
130
|
+
model_id: String,
|
|
131
|
+
provider: Telnyx::TextToSpeechStreamParams::Provider::OrSymbol,
|
|
132
|
+
socket_id: String,
|
|
133
|
+
voice: String,
|
|
134
|
+
voice_id: String,
|
|
135
|
+
request_options: Telnyx::RequestOptions
|
|
136
|
+
}
|
|
137
|
+
)
|
|
138
|
+
end
|
|
139
|
+
def to_hash
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# Audio output format override. Supported for Telnyx `Natural`/`NaturalHD` models
|
|
143
|
+
# only. Accepted values: `pcm`, `wav`.
|
|
144
|
+
module AudioFormat
|
|
145
|
+
extend Telnyx::Internal::Type::Enum
|
|
146
|
+
|
|
147
|
+
TaggedSymbol =
|
|
148
|
+
T.type_alias do
|
|
149
|
+
T.all(Symbol, Telnyx::TextToSpeechStreamParams::AudioFormat)
|
|
150
|
+
end
|
|
151
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
152
|
+
|
|
153
|
+
PCM =
|
|
154
|
+
T.let(
|
|
155
|
+
:pcm,
|
|
156
|
+
Telnyx::TextToSpeechStreamParams::AudioFormat::TaggedSymbol
|
|
157
|
+
)
|
|
158
|
+
WAV =
|
|
159
|
+
T.let(
|
|
160
|
+
:wav,
|
|
161
|
+
Telnyx::TextToSpeechStreamParams::AudioFormat::TaggedSymbol
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
sig do
|
|
165
|
+
override.returns(
|
|
166
|
+
T::Array[
|
|
167
|
+
Telnyx::TextToSpeechStreamParams::AudioFormat::TaggedSymbol
|
|
168
|
+
]
|
|
169
|
+
)
|
|
170
|
+
end
|
|
171
|
+
def self.values
|
|
172
|
+
end
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# TTS provider. Defaults to `telnyx` if not specified. Ignored when `voice` is
|
|
176
|
+
# provided.
|
|
177
|
+
module Provider
|
|
178
|
+
extend Telnyx::Internal::Type::Enum
|
|
179
|
+
|
|
180
|
+
TaggedSymbol =
|
|
181
|
+
T.type_alias do
|
|
182
|
+
T.all(Symbol, Telnyx::TextToSpeechStreamParams::Provider)
|
|
183
|
+
end
|
|
184
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
185
|
+
|
|
186
|
+
AWS =
|
|
187
|
+
T.let(:aws, Telnyx::TextToSpeechStreamParams::Provider::TaggedSymbol)
|
|
188
|
+
TELNYX =
|
|
189
|
+
T.let(
|
|
190
|
+
:telnyx,
|
|
191
|
+
Telnyx::TextToSpeechStreamParams::Provider::TaggedSymbol
|
|
192
|
+
)
|
|
193
|
+
AZURE =
|
|
194
|
+
T.let(
|
|
195
|
+
:azure,
|
|
196
|
+
Telnyx::TextToSpeechStreamParams::Provider::TaggedSymbol
|
|
197
|
+
)
|
|
198
|
+
ELEVENLABS =
|
|
199
|
+
T.let(
|
|
200
|
+
:elevenlabs,
|
|
201
|
+
Telnyx::TextToSpeechStreamParams::Provider::TaggedSymbol
|
|
202
|
+
)
|
|
203
|
+
MINIMAX =
|
|
204
|
+
T.let(
|
|
205
|
+
:minimax,
|
|
206
|
+
Telnyx::TextToSpeechStreamParams::Provider::TaggedSymbol
|
|
207
|
+
)
|
|
208
|
+
MURFAI =
|
|
209
|
+
T.let(
|
|
210
|
+
:murfai,
|
|
211
|
+
Telnyx::TextToSpeechStreamParams::Provider::TaggedSymbol
|
|
212
|
+
)
|
|
213
|
+
RIME =
|
|
214
|
+
T.let(:rime, Telnyx::TextToSpeechStreamParams::Provider::TaggedSymbol)
|
|
215
|
+
RESEMBLE =
|
|
216
|
+
T.let(
|
|
217
|
+
:resemble,
|
|
218
|
+
Telnyx::TextToSpeechStreamParams::Provider::TaggedSymbol
|
|
219
|
+
)
|
|
220
|
+
|
|
221
|
+
sig do
|
|
222
|
+
override.returns(
|
|
223
|
+
T::Array[Telnyx::TextToSpeechStreamParams::Provider::TaggedSymbol]
|
|
224
|
+
)
|
|
225
|
+
end
|
|
226
|
+
def self.values
|
|
227
|
+
end
|
|
228
|
+
end
|
|
229
|
+
end
|
|
230
|
+
end
|
|
231
|
+
end
|
data/rbi/telnyx/models.rbi
CHANGED
|
@@ -1648,11 +1648,10 @@ module Telnyx
|
|
|
1648
1648
|
|
|
1649
1649
|
TexmlSecretsParams = Telnyx::Models::TexmlSecretsParams
|
|
1650
1650
|
|
|
1651
|
-
TextToSpeechGenerateSpeechParams =
|
|
1652
|
-
Telnyx::Models::TextToSpeechGenerateSpeechParams
|
|
1653
|
-
|
|
1654
1651
|
TextToSpeechListVoicesParams = Telnyx::Models::TextToSpeechListVoicesParams
|
|
1655
1652
|
|
|
1653
|
+
TextToSpeechStreamParams = Telnyx::Models::TextToSpeechStreamParams
|
|
1654
|
+
|
|
1656
1655
|
TrafficType = Telnyx::Models::TrafficType
|
|
1657
1656
|
|
|
1658
1657
|
Transcription = Telnyx::Models::Transcription
|
|
@@ -410,6 +410,8 @@ module Telnyx
|
|
|
410
410
|
id: String,
|
|
411
411
|
format_:
|
|
412
412
|
Telnyx::Conferences::ActionRecordStartParams::Format::OrSymbol,
|
|
413
|
+
channels:
|
|
414
|
+
Telnyx::Conferences::ActionRecordStartParams::Channels::OrSymbol,
|
|
413
415
|
command_id: String,
|
|
414
416
|
custom_file_name: String,
|
|
415
417
|
play_beep: T::Boolean,
|
|
@@ -425,6 +427,9 @@ module Telnyx
|
|
|
425
427
|
# The audio file format used when storing the conference recording. Can be either
|
|
426
428
|
# `mp3` or `wav`.
|
|
427
429
|
format_:,
|
|
430
|
+
# When `dual`, final audio file will be stereo recorded with the conference
|
|
431
|
+
# creator on the first channel, and the rest on the second channel.
|
|
432
|
+
channels: nil,
|
|
428
433
|
# Use this field to avoid duplicate commands. Telnyx will ignore any command with
|
|
429
434
|
# the same `command_id` for the same `conference_id`.
|
|
430
435
|
command_id: nil,
|
|
@@ -3,34 +3,6 @@
|
|
|
3
3
|
module Telnyx
|
|
4
4
|
module Resources
|
|
5
5
|
class TextToSpeech
|
|
6
|
-
# Converts the provided text to speech using the specified voice and returns audio
|
|
7
|
-
# data
|
|
8
|
-
sig do
|
|
9
|
-
params(
|
|
10
|
-
text: String,
|
|
11
|
-
voice: String,
|
|
12
|
-
request_options: Telnyx::RequestOptions::OrHash
|
|
13
|
-
).returns(StringIO)
|
|
14
|
-
end
|
|
15
|
-
def generate_speech(
|
|
16
|
-
# The text to convert to speech
|
|
17
|
-
text:,
|
|
18
|
-
# The voice ID in the format Provider.ModelId.VoiceId.
|
|
19
|
-
#
|
|
20
|
-
# Examples:
|
|
21
|
-
#
|
|
22
|
-
# - AWS.Polly.Joanna-Neural
|
|
23
|
-
# - Azure.en-US-AvaMultilingualNeural
|
|
24
|
-
# - ElevenLabs.eleven_multilingual_v2.Rachel
|
|
25
|
-
# - Telnyx.KokoroTTS.af
|
|
26
|
-
#
|
|
27
|
-
# Use the `GET /text-to-speech/voices` endpoint to get a complete list of
|
|
28
|
-
# available voices.
|
|
29
|
-
voice:,
|
|
30
|
-
request_options: {}
|
|
31
|
-
)
|
|
32
|
-
end
|
|
33
|
-
|
|
34
6
|
# Returns a list of voices that can be used with the text to speech commands.
|
|
35
7
|
sig do
|
|
36
8
|
params(
|
|
@@ -48,6 +20,65 @@ module Telnyx
|
|
|
48
20
|
)
|
|
49
21
|
end
|
|
50
22
|
|
|
23
|
+
# Open a WebSocket connection to stream text and receive synthesized audio in real
|
|
24
|
+
# time. Authentication is provided via the standard
|
|
25
|
+
# `Authorization: Bearer <API_KEY>` header. Send JSON frames with text to
|
|
26
|
+
# synthesize; receive JSON frames containing base64-encoded audio chunks.
|
|
27
|
+
#
|
|
28
|
+
# Supported providers: `aws`, `telnyx`, `azure`, `murfai`, `minimax`, `rime`,
|
|
29
|
+
# `resemble`, `elevenlabs`.
|
|
30
|
+
#
|
|
31
|
+
# **Connection flow:**
|
|
32
|
+
#
|
|
33
|
+
# 1. Open WebSocket with query parameters specifying provider, voice, and model.
|
|
34
|
+
# 2. Send an initial handshake message `{"text": " "}` (single space) with
|
|
35
|
+
# optional `voice_settings` to initialize the session.
|
|
36
|
+
# 3. Send text messages as `{"text": "Hello world"}`.
|
|
37
|
+
# 4. Receive audio chunks as JSON frames with base64-encoded audio.
|
|
38
|
+
# 5. A final frame with `isFinal: true` indicates the end of audio for the current
|
|
39
|
+
# text.
|
|
40
|
+
#
|
|
41
|
+
# To interrupt and restart synthesis mid-stream, send `{"force": true}` — the
|
|
42
|
+
# current worker is stopped and a new one is started.
|
|
43
|
+
sig do
|
|
44
|
+
params(
|
|
45
|
+
audio_format: Telnyx::TextToSpeechStreamParams::AudioFormat::OrSymbol,
|
|
46
|
+
disable_cache: T::Boolean,
|
|
47
|
+
model_id: String,
|
|
48
|
+
provider: Telnyx::TextToSpeechStreamParams::Provider::OrSymbol,
|
|
49
|
+
socket_id: String,
|
|
50
|
+
voice: String,
|
|
51
|
+
voice_id: String,
|
|
52
|
+
request_options: Telnyx::RequestOptions::OrHash
|
|
53
|
+
).void
|
|
54
|
+
end
|
|
55
|
+
def stream(
|
|
56
|
+
# Audio output format override. Supported for Telnyx `Natural`/`NaturalHD` models
|
|
57
|
+
# only. Accepted values: `pcm`, `wav`.
|
|
58
|
+
audio_format: nil,
|
|
59
|
+
# When `true`, bypass the audio cache and generate fresh audio.
|
|
60
|
+
disable_cache: nil,
|
|
61
|
+
# Model identifier for the chosen provider. Examples: `Natural`, `NaturalHD`
|
|
62
|
+
# (Telnyx); `Polly.Generative` (AWS).
|
|
63
|
+
model_id: nil,
|
|
64
|
+
# TTS provider. Defaults to `telnyx` if not specified. Ignored when `voice` is
|
|
65
|
+
# provided.
|
|
66
|
+
provider: nil,
|
|
67
|
+
# Client-provided socket identifier for tracking. If not provided, one is
|
|
68
|
+
# generated server-side.
|
|
69
|
+
socket_id: nil,
|
|
70
|
+
# Voice identifier in the format `provider.model_id.voice_id` or
|
|
71
|
+
# `provider.voice_id` (e.g. `telnyx.NaturalHD.Telnyx_Alloy` or
|
|
72
|
+
# `azure.en-US-AvaMultilingualNeural`). When provided, the `provider`, `model_id`,
|
|
73
|
+
# and `voice_id` are extracted automatically. Takes precedence over individual
|
|
74
|
+
# `provider`/`model_id`/`voice_id` parameters.
|
|
75
|
+
voice: nil,
|
|
76
|
+
# Voice identifier for the chosen provider.
|
|
77
|
+
voice_id: nil,
|
|
78
|
+
request_options: {}
|
|
79
|
+
)
|
|
80
|
+
end
|
|
81
|
+
|
|
51
82
|
# @api private
|
|
52
83
|
sig { params(client: Telnyx::Client).returns(T.attached_class) }
|
|
53
84
|
def self.new(client:)
|
|
@@ -4,6 +4,7 @@ module Telnyx
|
|
|
4
4
|
type action_record_start_params =
|
|
5
5
|
{
|
|
6
6
|
format_: Telnyx::Models::Conferences::ActionRecordStartParams::format_,
|
|
7
|
+
channels: Telnyx::Models::Conferences::ActionRecordStartParams::channels,
|
|
7
8
|
command_id: String,
|
|
8
9
|
custom_file_name: String,
|
|
9
10
|
play_beep: bool,
|
|
@@ -18,6 +19,12 @@ module Telnyx
|
|
|
18
19
|
|
|
19
20
|
attr_accessor format_: Telnyx::Models::Conferences::ActionRecordStartParams::format_
|
|
20
21
|
|
|
22
|
+
attr_reader channels: Telnyx::Models::Conferences::ActionRecordStartParams::channels?
|
|
23
|
+
|
|
24
|
+
def channels=: (
|
|
25
|
+
Telnyx::Models::Conferences::ActionRecordStartParams::channels
|
|
26
|
+
) -> Telnyx::Models::Conferences::ActionRecordStartParams::channels
|
|
27
|
+
|
|
21
28
|
attr_reader command_id: String?
|
|
22
29
|
|
|
23
30
|
def command_id=: (String) -> String
|
|
@@ -44,6 +51,7 @@ module Telnyx
|
|
|
44
51
|
|
|
45
52
|
def initialize: (
|
|
46
53
|
format_: Telnyx::Models::Conferences::ActionRecordStartParams::format_,
|
|
54
|
+
?channels: Telnyx::Models::Conferences::ActionRecordStartParams::channels,
|
|
47
55
|
?command_id: String,
|
|
48
56
|
?custom_file_name: String,
|
|
49
57
|
?play_beep: bool,
|
|
@@ -54,6 +62,7 @@ module Telnyx
|
|
|
54
62
|
|
|
55
63
|
def to_hash: -> {
|
|
56
64
|
format_: Telnyx::Models::Conferences::ActionRecordStartParams::format_,
|
|
65
|
+
channels: Telnyx::Models::Conferences::ActionRecordStartParams::channels,
|
|
57
66
|
command_id: String,
|
|
58
67
|
custom_file_name: String,
|
|
59
68
|
play_beep: bool,
|
|
@@ -73,6 +82,17 @@ module Telnyx
|
|
|
73
82
|
def self?.values: -> ::Array[Telnyx::Models::Conferences::ActionRecordStartParams::format_]
|
|
74
83
|
end
|
|
75
84
|
|
|
85
|
+
type channels = :single | :dual
|
|
86
|
+
|
|
87
|
+
module Channels
|
|
88
|
+
extend Telnyx::Internal::Type::Enum
|
|
89
|
+
|
|
90
|
+
SINGLE: :single
|
|
91
|
+
DUAL: :dual
|
|
92
|
+
|
|
93
|
+
def self?.values: -> ::Array[Telnyx::Models::Conferences::ActionRecordStartParams::channels]
|
|
94
|
+
end
|
|
95
|
+
|
|
76
96
|
type region = :Australia | :Europe | :"Middle East" | :US
|
|
77
97
|
|
|
78
98
|
module Region
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
module Telnyx
|
|
2
|
+
module Models
|
|
3
|
+
type text_to_speech_stream_params =
|
|
4
|
+
{
|
|
5
|
+
audio_format: Telnyx::Models::TextToSpeechStreamParams::audio_format,
|
|
6
|
+
disable_cache: bool,
|
|
7
|
+
model_id: String,
|
|
8
|
+
provider: Telnyx::Models::TextToSpeechStreamParams::provider,
|
|
9
|
+
socket_id: String,
|
|
10
|
+
voice: String,
|
|
11
|
+
voice_id: String
|
|
12
|
+
}
|
|
13
|
+
& Telnyx::Internal::Type::request_parameters
|
|
14
|
+
|
|
15
|
+
class TextToSpeechStreamParams < Telnyx::Internal::Type::BaseModel
|
|
16
|
+
extend Telnyx::Internal::Type::RequestParameters::Converter
|
|
17
|
+
include Telnyx::Internal::Type::RequestParameters
|
|
18
|
+
|
|
19
|
+
attr_reader audio_format: Telnyx::Models::TextToSpeechStreamParams::audio_format?
|
|
20
|
+
|
|
21
|
+
def audio_format=: (
|
|
22
|
+
Telnyx::Models::TextToSpeechStreamParams::audio_format
|
|
23
|
+
) -> Telnyx::Models::TextToSpeechStreamParams::audio_format
|
|
24
|
+
|
|
25
|
+
attr_reader disable_cache: bool?
|
|
26
|
+
|
|
27
|
+
def disable_cache=: (bool) -> bool
|
|
28
|
+
|
|
29
|
+
attr_reader model_id: String?
|
|
30
|
+
|
|
31
|
+
def model_id=: (String) -> String
|
|
32
|
+
|
|
33
|
+
attr_reader provider: Telnyx::Models::TextToSpeechStreamParams::provider?
|
|
34
|
+
|
|
35
|
+
def provider=: (
|
|
36
|
+
Telnyx::Models::TextToSpeechStreamParams::provider
|
|
37
|
+
) -> Telnyx::Models::TextToSpeechStreamParams::provider
|
|
38
|
+
|
|
39
|
+
attr_reader socket_id: String?
|
|
40
|
+
|
|
41
|
+
def socket_id=: (String) -> String
|
|
42
|
+
|
|
43
|
+
attr_reader voice: String?
|
|
44
|
+
|
|
45
|
+
def voice=: (String) -> String
|
|
46
|
+
|
|
47
|
+
attr_reader voice_id: String?
|
|
48
|
+
|
|
49
|
+
def voice_id=: (String) -> String
|
|
50
|
+
|
|
51
|
+
def initialize: (
|
|
52
|
+
?audio_format: Telnyx::Models::TextToSpeechStreamParams::audio_format,
|
|
53
|
+
?disable_cache: bool,
|
|
54
|
+
?model_id: String,
|
|
55
|
+
?provider: Telnyx::Models::TextToSpeechStreamParams::provider,
|
|
56
|
+
?socket_id: String,
|
|
57
|
+
?voice: String,
|
|
58
|
+
?voice_id: String,
|
|
59
|
+
?request_options: Telnyx::request_opts
|
|
60
|
+
) -> void
|
|
61
|
+
|
|
62
|
+
def to_hash: -> {
|
|
63
|
+
audio_format: Telnyx::Models::TextToSpeechStreamParams::audio_format,
|
|
64
|
+
disable_cache: bool,
|
|
65
|
+
model_id: String,
|
|
66
|
+
provider: Telnyx::Models::TextToSpeechStreamParams::provider,
|
|
67
|
+
socket_id: String,
|
|
68
|
+
voice: String,
|
|
69
|
+
voice_id: String,
|
|
70
|
+
request_options: Telnyx::RequestOptions
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
type audio_format = :pcm | :wav
|
|
74
|
+
|
|
75
|
+
module AudioFormat
|
|
76
|
+
extend Telnyx::Internal::Type::Enum
|
|
77
|
+
|
|
78
|
+
PCM: :pcm
|
|
79
|
+
WAV: :wav
|
|
80
|
+
|
|
81
|
+
def self?.values: -> ::Array[Telnyx::Models::TextToSpeechStreamParams::audio_format]
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
type provider =
|
|
85
|
+
:aws
|
|
86
|
+
| :telnyx
|
|
87
|
+
| :azure
|
|
88
|
+
| :elevenlabs
|
|
89
|
+
| :minimax
|
|
90
|
+
| :murfai
|
|
91
|
+
| :rime
|
|
92
|
+
| :resemble
|
|
93
|
+
|
|
94
|
+
module Provider
|
|
95
|
+
extend Telnyx::Internal::Type::Enum
|
|
96
|
+
|
|
97
|
+
AWS: :aws
|
|
98
|
+
TELNYX: :telnyx
|
|
99
|
+
AZURE: :azure
|
|
100
|
+
ELEVENLABS: :elevenlabs
|
|
101
|
+
MINIMAX: :minimax
|
|
102
|
+
MURFAI: :murfai
|
|
103
|
+
RIME: :rime
|
|
104
|
+
RESEMBLE: :resemble
|
|
105
|
+
|
|
106
|
+
def self?.values: -> ::Array[Telnyx::Models::TextToSpeechStreamParams::provider]
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
end
|
data/sig/telnyx/models.rbs
CHANGED
|
@@ -1431,10 +1431,10 @@ module Telnyx
|
|
|
1431
1431
|
|
|
1432
1432
|
class TexmlSecretsParams = Telnyx::Models::TexmlSecretsParams
|
|
1433
1433
|
|
|
1434
|
-
class TextToSpeechGenerateSpeechParams = Telnyx::Models::TextToSpeechGenerateSpeechParams
|
|
1435
|
-
|
|
1436
1434
|
class TextToSpeechListVoicesParams = Telnyx::Models::TextToSpeechListVoicesParams
|
|
1437
1435
|
|
|
1436
|
+
class TextToSpeechStreamParams = Telnyx::Models::TextToSpeechStreamParams
|
|
1437
|
+
|
|
1438
1438
|
module TrafficType = Telnyx::Models::TrafficType
|
|
1439
1439
|
|
|
1440
1440
|
class Transcription = Telnyx::Models::Transcription
|
|
@@ -112,6 +112,7 @@ module Telnyx
|
|
|
112
112
|
def record_start: (
|
|
113
113
|
String id,
|
|
114
114
|
format_: Telnyx::Models::Conferences::ActionRecordStartParams::format_,
|
|
115
|
+
?channels: Telnyx::Models::Conferences::ActionRecordStartParams::channels,
|
|
115
116
|
?command_id: String,
|
|
116
117
|
?custom_file_name: String,
|
|
117
118
|
?play_beep: bool,
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
module Telnyx
|
|
2
2
|
module Resources
|
|
3
3
|
class TextToSpeech
|
|
4
|
-
def generate_speech: (
|
|
5
|
-
text: String,
|
|
6
|
-
voice: String,
|
|
7
|
-
?request_options: Telnyx::request_opts
|
|
8
|
-
) -> StringIO
|
|
9
|
-
|
|
10
4
|
def list_voices: (
|
|
11
5
|
?elevenlabs_api_key_ref: String,
|
|
12
6
|
?provider: Telnyx::Models::TextToSpeechListVoicesParams::provider,
|
|
13
7
|
?request_options: Telnyx::request_opts
|
|
14
8
|
) -> Telnyx::Models::TextToSpeechListVoicesResponse
|
|
15
9
|
|
|
10
|
+
def stream: (
|
|
11
|
+
?audio_format: Telnyx::Models::TextToSpeechStreamParams::audio_format,
|
|
12
|
+
?disable_cache: bool,
|
|
13
|
+
?model_id: String,
|
|
14
|
+
?provider: Telnyx::Models::TextToSpeechStreamParams::provider,
|
|
15
|
+
?socket_id: String,
|
|
16
|
+
?voice: String,
|
|
17
|
+
?voice_id: String,
|
|
18
|
+
?request_options: Telnyx::request_opts
|
|
19
|
+
) -> nil
|
|
20
|
+
|
|
16
21
|
def initialize: (client: Telnyx::Client) -> void
|
|
17
22
|
end
|
|
18
23
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: telnyx
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.
|
|
4
|
+
version: 5.45.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Telnyx
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-02-
|
|
11
|
+
date: 2026-02-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: cgi
|
|
@@ -2053,9 +2053,9 @@ files:
|
|
|
2053
2053
|
- lib/telnyx/models/texml_application_update_response.rb
|
|
2054
2054
|
- lib/telnyx/models/texml_secrets_params.rb
|
|
2055
2055
|
- lib/telnyx/models/texml_secrets_response.rb
|
|
2056
|
-
- lib/telnyx/models/text_to_speech_generate_speech_params.rb
|
|
2057
2056
|
- lib/telnyx/models/text_to_speech_list_voices_params.rb
|
|
2058
2057
|
- lib/telnyx/models/text_to_speech_list_voices_response.rb
|
|
2058
|
+
- lib/telnyx/models/text_to_speech_stream_params.rb
|
|
2059
2059
|
- lib/telnyx/models/traffic_type.rb
|
|
2060
2060
|
- lib/telnyx/models/transcription.rb
|
|
2061
2061
|
- lib/telnyx/models/transcription_webhook_event.rb
|
|
@@ -4475,9 +4475,9 @@ files:
|
|
|
4475
4475
|
- rbi/telnyx/models/texml_application_update_response.rbi
|
|
4476
4476
|
- rbi/telnyx/models/texml_secrets_params.rbi
|
|
4477
4477
|
- rbi/telnyx/models/texml_secrets_response.rbi
|
|
4478
|
-
- rbi/telnyx/models/text_to_speech_generate_speech_params.rbi
|
|
4479
4478
|
- rbi/telnyx/models/text_to_speech_list_voices_params.rbi
|
|
4480
4479
|
- rbi/telnyx/models/text_to_speech_list_voices_response.rbi
|
|
4480
|
+
- rbi/telnyx/models/text_to_speech_stream_params.rbi
|
|
4481
4481
|
- rbi/telnyx/models/traffic_type.rbi
|
|
4482
4482
|
- rbi/telnyx/models/transcription.rbi
|
|
4483
4483
|
- rbi/telnyx/models/transcription_webhook_event.rbi
|
|
@@ -6896,9 +6896,9 @@ files:
|
|
|
6896
6896
|
- sig/telnyx/models/texml_application_update_response.rbs
|
|
6897
6897
|
- sig/telnyx/models/texml_secrets_params.rbs
|
|
6898
6898
|
- sig/telnyx/models/texml_secrets_response.rbs
|
|
6899
|
-
- sig/telnyx/models/text_to_speech_generate_speech_params.rbs
|
|
6900
6899
|
- sig/telnyx/models/text_to_speech_list_voices_params.rbs
|
|
6901
6900
|
- sig/telnyx/models/text_to_speech_list_voices_response.rbs
|
|
6901
|
+
- sig/telnyx/models/text_to_speech_stream_params.rbs
|
|
6902
6902
|
- sig/telnyx/models/traffic_type.rbs
|
|
6903
6903
|
- sig/telnyx/models/transcription.rbs
|
|
6904
6904
|
- sig/telnyx/models/transcription_webhook_event.rbs
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Telnyx
|
|
4
|
-
module Models
|
|
5
|
-
# @see Telnyx::Resources::TextToSpeech#generate_speech
|
|
6
|
-
class TextToSpeechGenerateSpeechParams < Telnyx::Internal::Type::BaseModel
|
|
7
|
-
extend Telnyx::Internal::Type::RequestParameters::Converter
|
|
8
|
-
include Telnyx::Internal::Type::RequestParameters
|
|
9
|
-
|
|
10
|
-
# @!attribute text
|
|
11
|
-
# The text to convert to speech
|
|
12
|
-
#
|
|
13
|
-
# @return [String]
|
|
14
|
-
required :text, String
|
|
15
|
-
|
|
16
|
-
# @!attribute voice
|
|
17
|
-
# The voice ID in the format Provider.ModelId.VoiceId.
|
|
18
|
-
#
|
|
19
|
-
# Examples:
|
|
20
|
-
#
|
|
21
|
-
# - AWS.Polly.Joanna-Neural
|
|
22
|
-
# - Azure.en-US-AvaMultilingualNeural
|
|
23
|
-
# - ElevenLabs.eleven_multilingual_v2.Rachel
|
|
24
|
-
# - Telnyx.KokoroTTS.af
|
|
25
|
-
#
|
|
26
|
-
# Use the `GET /text-to-speech/voices` endpoint to get a complete list of
|
|
27
|
-
# available voices.
|
|
28
|
-
#
|
|
29
|
-
# @return [String]
|
|
30
|
-
required :voice, String
|
|
31
|
-
|
|
32
|
-
# @!method initialize(text:, voice:, request_options: {})
|
|
33
|
-
# Some parameter documentations has been truncated, see
|
|
34
|
-
# {Telnyx::Models::TextToSpeechGenerateSpeechParams} for more details.
|
|
35
|
-
#
|
|
36
|
-
# @param text [String] The text to convert to speech
|
|
37
|
-
#
|
|
38
|
-
# @param voice [String] The voice ID in the format Provider.ModelId.VoiceId.
|
|
39
|
-
#
|
|
40
|
-
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}]
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
end
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
# typed: strong
|
|
2
|
-
|
|
3
|
-
module Telnyx
|
|
4
|
-
module Models
|
|
5
|
-
class TextToSpeechGenerateSpeechParams < Telnyx::Internal::Type::BaseModel
|
|
6
|
-
extend Telnyx::Internal::Type::RequestParameters::Converter
|
|
7
|
-
include Telnyx::Internal::Type::RequestParameters
|
|
8
|
-
|
|
9
|
-
OrHash =
|
|
10
|
-
T.type_alias do
|
|
11
|
-
T.any(
|
|
12
|
-
Telnyx::TextToSpeechGenerateSpeechParams,
|
|
13
|
-
Telnyx::Internal::AnyHash
|
|
14
|
-
)
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
# The text to convert to speech
|
|
18
|
-
sig { returns(String) }
|
|
19
|
-
attr_accessor :text
|
|
20
|
-
|
|
21
|
-
# The voice ID in the format Provider.ModelId.VoiceId.
|
|
22
|
-
#
|
|
23
|
-
# Examples:
|
|
24
|
-
#
|
|
25
|
-
# - AWS.Polly.Joanna-Neural
|
|
26
|
-
# - Azure.en-US-AvaMultilingualNeural
|
|
27
|
-
# - ElevenLabs.eleven_multilingual_v2.Rachel
|
|
28
|
-
# - Telnyx.KokoroTTS.af
|
|
29
|
-
#
|
|
30
|
-
# Use the `GET /text-to-speech/voices` endpoint to get a complete list of
|
|
31
|
-
# available voices.
|
|
32
|
-
sig { returns(String) }
|
|
33
|
-
attr_accessor :voice
|
|
34
|
-
|
|
35
|
-
sig do
|
|
36
|
-
params(
|
|
37
|
-
text: String,
|
|
38
|
-
voice: String,
|
|
39
|
-
request_options: Telnyx::RequestOptions::OrHash
|
|
40
|
-
).returns(T.attached_class)
|
|
41
|
-
end
|
|
42
|
-
def self.new(
|
|
43
|
-
# The text to convert to speech
|
|
44
|
-
text:,
|
|
45
|
-
# The voice ID in the format Provider.ModelId.VoiceId.
|
|
46
|
-
#
|
|
47
|
-
# Examples:
|
|
48
|
-
#
|
|
49
|
-
# - AWS.Polly.Joanna-Neural
|
|
50
|
-
# - Azure.en-US-AvaMultilingualNeural
|
|
51
|
-
# - ElevenLabs.eleven_multilingual_v2.Rachel
|
|
52
|
-
# - Telnyx.KokoroTTS.af
|
|
53
|
-
#
|
|
54
|
-
# Use the `GET /text-to-speech/voices` endpoint to get a complete list of
|
|
55
|
-
# available voices.
|
|
56
|
-
voice:,
|
|
57
|
-
request_options: {}
|
|
58
|
-
)
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
sig do
|
|
62
|
-
override.returns(
|
|
63
|
-
{
|
|
64
|
-
text: String,
|
|
65
|
-
voice: String,
|
|
66
|
-
request_options: Telnyx::RequestOptions
|
|
67
|
-
}
|
|
68
|
-
)
|
|
69
|
-
end
|
|
70
|
-
def to_hash
|
|
71
|
-
end
|
|
72
|
-
end
|
|
73
|
-
end
|
|
74
|
-
end
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
module Telnyx
|
|
2
|
-
module Models
|
|
3
|
-
type text_to_speech_generate_speech_params =
|
|
4
|
-
{ text: String, voice: String }
|
|
5
|
-
& Telnyx::Internal::Type::request_parameters
|
|
6
|
-
|
|
7
|
-
class TextToSpeechGenerateSpeechParams < Telnyx::Internal::Type::BaseModel
|
|
8
|
-
extend Telnyx::Internal::Type::RequestParameters::Converter
|
|
9
|
-
include Telnyx::Internal::Type::RequestParameters
|
|
10
|
-
|
|
11
|
-
attr_accessor text: String
|
|
12
|
-
|
|
13
|
-
attr_accessor voice: String
|
|
14
|
-
|
|
15
|
-
def initialize: (
|
|
16
|
-
text: String,
|
|
17
|
-
voice: String,
|
|
18
|
-
?request_options: Telnyx::request_opts
|
|
19
|
-
) -> void
|
|
20
|
-
|
|
21
|
-
def to_hash: -> {
|
|
22
|
-
text: String,
|
|
23
|
-
voice: String,
|
|
24
|
-
request_options: Telnyx::RequestOptions
|
|
25
|
-
}
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|