murf 2.0.2__tar.gz → 2.2.0__tar.gz

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.
Files changed (105) hide show
  1. {murf-2.0.2 → murf-2.2.0}/PKG-INFO +1 -1
  2. {murf-2.0.2 → murf-2.2.0}/pyproject.toml +1 -1
  3. {murf-2.0.2 → murf-2.2.0}/src/murf/__init__.py +2 -3
  4. {murf-2.0.2 → murf-2.2.0}/src/murf/core/client_wrapper.py +1 -1
  5. {murf-2.0.2 → murf-2.2.0}/src/murf/dubbing/projects/client.py +8 -2
  6. murf-2.2.0/src/murf/environment.py +58 -0
  7. murf-2.2.0/src/murf/stream_input/__init__.py +5 -0
  8. {murf-2.0.2 → murf-2.2.0}/src/murf/stream_input/types/__init__.py +2 -1
  9. murf-2.2.0/src/murf/stream_input/types/text_to_speech_model.py +5 -0
  10. {murf-2.0.2 → murf-2.2.0}/src/murf/text_to_speech/client.py +78 -35
  11. {murf-2.0.2 → murf-2.2.0}/src/murf/types/generate_speech_response.py +4 -4
  12. {murf-2.0.2 → murf-2.2.0}/src/murf/types/send_text_voice_config.py +1 -1
  13. {murf-2.0.2 → murf-2.2.0}/src/murf/types/set_voice_configuration_or_initialize_context_voice_config.py +1 -1
  14. murf-2.2.0/src/murf/voice_changer/__init__.py +2 -0
  15. murf-2.0.2/src/murf/environment.py +0 -14
  16. murf-2.0.2/src/murf/stream_input/__init__.py +0 -5
  17. murf-2.0.2/src/murf/text_to_speech/__init__.py +0 -5
  18. murf-2.0.2/src/murf/text_to_speech/types/__init__.py +0 -5
  19. murf-2.0.2/src/murf/text_to_speech/types/generate_speech_request_model_version.py +0 -5
  20. {murf-2.0.2 → murf-2.2.0}/LICENSE +0 -0
  21. {murf-2.0.2 → murf-2.2.0}/README.md +0 -0
  22. {murf-2.0.2 → murf-2.2.0}/src/murf/auth/__init__.py +0 -0
  23. {murf-2.0.2 → murf-2.2.0}/src/murf/auth/client.py +0 -0
  24. {murf-2.0.2 → murf-2.2.0}/src/murf/base_client.py +0 -0
  25. {murf-2.0.2 → murf-2.2.0}/src/murf/client.py +0 -0
  26. {murf-2.0.2 → murf-2.2.0}/src/murf/core/__init__.py +0 -0
  27. {murf-2.0.2 → murf-2.2.0}/src/murf/core/api_error.py +0 -0
  28. {murf-2.0.2 → murf-2.2.0}/src/murf/core/datetime_utils.py +0 -0
  29. {murf-2.0.2 → murf-2.2.0}/src/murf/core/file.py +0 -0
  30. {murf-2.0.2 → murf-2.2.0}/src/murf/core/http_client.py +0 -0
  31. {murf-2.0.2 → murf-2.2.0}/src/murf/core/jsonable_encoder.py +0 -0
  32. {murf-2.0.2 → murf-2.2.0}/src/murf/core/pydantic_utilities.py +0 -0
  33. {murf-2.0.2 → murf-2.2.0}/src/murf/core/query_encoder.py +0 -0
  34. {murf-2.0.2 → murf-2.2.0}/src/murf/core/remove_none_from_dict.py +0 -0
  35. {murf-2.0.2 → murf-2.2.0}/src/murf/core/request_options.py +0 -0
  36. {murf-2.0.2 → murf-2.2.0}/src/murf/core/serialization.py +0 -0
  37. {murf-2.0.2 → murf-2.2.0}/src/murf/core/unchecked_base_model.py +0 -0
  38. {murf-2.0.2 → murf-2.2.0}/src/murf/dubbing/__init__.py +0 -0
  39. {murf-2.0.2 → murf-2.2.0}/src/murf/dubbing/client.py +0 -0
  40. {murf-2.0.2 → murf-2.2.0}/src/murf/dubbing/jobs/__init__.py +0 -0
  41. {murf-2.0.2 → murf-2.2.0}/src/murf/dubbing/jobs/client.py +0 -0
  42. {murf-2.0.2 → murf-2.2.0}/src/murf/dubbing/jobs/types/__init__.py +0 -0
  43. {murf-2.0.2 → murf-2.2.0}/src/murf/dubbing/jobs/types/jobs_create_request_priority.py +0 -0
  44. {murf-2.0.2 → murf-2.2.0}/src/murf/dubbing/jobs/types/jobs_create_with_project_id_request_priority.py +0 -0
  45. {murf-2.0.2 → murf-2.2.0}/src/murf/dubbing/languages/__init__.py +0 -0
  46. {murf-2.0.2 → murf-2.2.0}/src/murf/dubbing/languages/client.py +0 -0
  47. {murf-2.0.2 → murf-2.2.0}/src/murf/dubbing/projects/__init__.py +0 -0
  48. {murf-2.0.2 → murf-2.2.0}/src/murf/dubbing/projects/types/__init__.py +0 -0
  49. {murf-2.0.2 → murf-2.2.0}/src/murf/dubbing/projects/types/api_create_project_request_dubbing_type.py +0 -0
  50. {murf-2.0.2 → murf-2.2.0}/src/murf/dubbing_client.py +0 -0
  51. {murf-2.0.2 → murf-2.2.0}/src/murf/errors/__init__.py +0 -0
  52. {murf-2.0.2 → murf-2.2.0}/src/murf/errors/bad_request_error.py +0 -0
  53. {murf-2.0.2 → murf-2.2.0}/src/murf/errors/forbidden_error.py +0 -0
  54. {murf-2.0.2 → murf-2.2.0}/src/murf/errors/internal_server_error.py +0 -0
  55. {murf-2.0.2 → murf-2.2.0}/src/murf/errors/payment_required_error.py +0 -0
  56. {murf-2.0.2 → murf-2.2.0}/src/murf/errors/service_unavailable_error.py +0 -0
  57. {murf-2.0.2 → murf-2.2.0}/src/murf/errors/unauthorized_error.py +0 -0
  58. {murf-2.0.2 → murf-2.2.0}/src/murf/py.typed +0 -0
  59. {murf-2.0.2 → murf-2.2.0}/src/murf/stream_input/types/receive_message.py +0 -0
  60. {murf-2.0.2 → murf-2.2.0}/src/murf/stream_input/types/send_message.py +0 -0
  61. {murf-2.0.2 → murf-2.2.0}/src/murf/text/__init__.py +0 -0
  62. {murf-2.0.2 → murf-2.2.0}/src/murf/text/client.py +0 -0
  63. {murf-2.0.2/src/murf/voice_changer → murf-2.2.0/src/murf/text_to_speech}/__init__.py +0 -0
  64. {murf-2.0.2 → murf-2.2.0}/src/murf/types/__init__.py +0 -0
  65. {murf-2.0.2 → murf-2.2.0}/src/murf/types/api_job_response.py +0 -0
  66. {murf-2.0.2 → murf-2.2.0}/src/murf/types/api_job_response_dubbing_type.py +0 -0
  67. {murf-2.0.2 → murf-2.2.0}/src/murf/types/api_job_response_priority.py +0 -0
  68. {murf-2.0.2 → murf-2.2.0}/src/murf/types/api_project_response.py +0 -0
  69. {murf-2.0.2 → murf-2.2.0}/src/murf/types/api_project_response_dubbing_type.py +0 -0
  70. {murf-2.0.2 → murf-2.2.0}/src/murf/types/api_voice.py +0 -0
  71. {murf-2.0.2 → murf-2.2.0}/src/murf/types/api_voice_gender.py +0 -0
  72. {murf-2.0.2 → murf-2.2.0}/src/murf/types/audio_output.py +0 -0
  73. {murf-2.0.2 → murf-2.2.0}/src/murf/types/auth_token_response.py +0 -0
  74. {murf-2.0.2 → murf-2.2.0}/src/murf/types/character_count.py +0 -0
  75. {murf-2.0.2 → murf-2.2.0}/src/murf/types/clear_context.py +0 -0
  76. {murf-2.0.2 → murf-2.2.0}/src/murf/types/dub_api_detail_response.py +0 -0
  77. {murf-2.0.2 → murf-2.2.0}/src/murf/types/dub_job_status_response.py +0 -0
  78. {murf-2.0.2 → murf-2.2.0}/src/murf/types/final_output.py +0 -0
  79. {murf-2.0.2 → murf-2.2.0}/src/murf/types/form_data_content_disposition.py +0 -0
  80. {murf-2.0.2 → murf-2.2.0}/src/murf/types/group_api_project_response.py +0 -0
  81. {murf-2.0.2 → murf-2.2.0}/src/murf/types/locale_response.py +0 -0
  82. {murf-2.0.2 → murf-2.2.0}/src/murf/types/locale_response_supports_item.py +0 -0
  83. {murf-2.0.2 → murf-2.2.0}/src/murf/types/metadata.py +0 -0
  84. {murf-2.0.2 → murf-2.2.0}/src/murf/types/murf_api_translation_response.py +0 -0
  85. {murf-2.0.2 → murf-2.2.0}/src/murf/types/pronunciation_detail.py +0 -0
  86. {murf-2.0.2 → murf-2.2.0}/src/murf/types/pronunciation_detail_type.py +0 -0
  87. {murf-2.0.2 → murf-2.2.0}/src/murf/types/send_text.py +0 -0
  88. {murf-2.0.2 → murf-2.2.0}/src/murf/types/send_text_voice_config_pronunciation_dictionary_value.py +0 -0
  89. {murf-2.0.2 → murf-2.2.0}/src/murf/types/send_text_voice_config_pronunciation_dictionary_value_type.py +0 -0
  90. {murf-2.0.2 → murf-2.2.0}/src/murf/types/set_advanced_settings.py +0 -0
  91. {murf-2.0.2 → murf-2.2.0}/src/murf/types/set_voice_configuration_or_initialize_context.py +0 -0
  92. {murf-2.0.2 → murf-2.2.0}/src/murf/types/set_voice_configuration_or_initialize_context_voice_config_pronunciation_dictionary_value.py +0 -0
  93. {murf-2.0.2 → murf-2.2.0}/src/murf/types/set_voice_configuration_or_initialize_context_voice_config_pronunciation_dictionary_value_type.py +0 -0
  94. {murf-2.0.2 → murf-2.2.0}/src/murf/types/source_locale_response.py +0 -0
  95. {murf-2.0.2 → murf-2.2.0}/src/murf/types/speech_to_speech_response.py +0 -0
  96. {murf-2.0.2 → murf-2.2.0}/src/murf/types/style_details.py +0 -0
  97. {murf-2.0.2 → murf-2.2.0}/src/murf/types/translation.py +0 -0
  98. {murf-2.0.2 → murf-2.2.0}/src/murf/types/tts_request_both_payload.py +0 -0
  99. {murf-2.0.2 → murf-2.2.0}/src/murf/types/tts_request_both_payload_voice_config.py +0 -0
  100. {murf-2.0.2 → murf-2.2.0}/src/murf/types/tts_request_both_payload_voice_config_pronunciation_dictionary.py +0 -0
  101. {murf-2.0.2 → murf-2.2.0}/src/murf/types/tts_request_both_payload_voice_config_pronunciation_dictionary_guess.py +0 -0
  102. {murf-2.0.2 → murf-2.2.0}/src/murf/types/word_duration_response.py +0 -0
  103. {murf-2.0.2 → murf-2.2.0}/src/murf/utils.py +0 -0
  104. {murf-2.0.2 → murf-2.2.0}/src/murf/version.py +0 -0
  105. {murf-2.0.2 → murf-2.2.0}/src/murf/voice_changer/client.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: murf
3
- Version: 2.0.2
3
+ Version: 2.2.0
4
4
  Summary:
5
5
  Requires-Python: >=3.8,<4.0
6
6
  Classifier: Intended Audience :: Developers
@@ -3,7 +3,7 @@ name = "murf"
3
3
 
4
4
  [tool.poetry]
5
5
  name = "murf"
6
- version = "2.0.2"
6
+ version = "2.2.0"
7
7
  description = ""
8
8
  readme = "README.md"
9
9
  authors = []
@@ -55,8 +55,7 @@ from . import auth, dubbing, stream_input, text, text_to_speech, voice_changer
55
55
  from .client import AsyncMurf, Murf
56
56
  from .dubbing_client import MurfDub
57
57
  from .environment import MurfEnvironment
58
- from .stream_input import ReceiveMessage, SendMessage
59
- from .text_to_speech import GenerateSpeechRequestModelVersion
58
+ from .stream_input import ReceiveMessage, SendMessage, TextToSpeechModel
60
59
  from .version import __version__
61
60
 
62
61
  __all__ = [
@@ -78,7 +77,6 @@ __all__ = [
78
77
  "FinalOutput",
79
78
  "ForbiddenError",
80
79
  "FormDataContentDisposition",
81
- "GenerateSpeechRequestModelVersion",
82
80
  "GenerateSpeechResponse",
83
81
  "GroupApiProjectResponse",
84
82
  "InternalServerError",
@@ -107,6 +105,7 @@ __all__ = [
107
105
  "SourceLocaleResponse",
108
106
  "SpeechToSpeechResponse",
109
107
  "StyleDetails",
108
+ "TextToSpeechModel",
110
109
  "Translation",
111
110
  "TtsRequestBothPayload",
112
111
  "TtsRequestBothPayloadVoiceConfig",
@@ -23,7 +23,7 @@ class BaseClientWrapper:
23
23
  headers: typing.Dict[str, str] = {
24
24
  "X-Fern-Language": "Python",
25
25
  "X-Fern-SDK-Name": "murf",
26
- "X-Fern-SDK-Version": "2.0.2",
26
+ "X-Fern-SDK-Version": "2.2.0",
27
27
  }
28
28
  if self._api_key is not None:
29
29
  headers["api-key"] = self._api_key
@@ -173,7 +173,10 @@ class ProjectsClient:
173
173
  client = Murf(
174
174
  api_key="YOUR_API_KEY",
175
175
  )
176
- client.dubbing.projects.list()
176
+ client.dubbing.projects.list(
177
+ limit=1,
178
+ next="next",
179
+ )
177
180
  """
178
181
  _response = self._client_wrapper.httpx_client.request(
179
182
  "v1/murfdub/projects/list",
@@ -508,7 +511,10 @@ class AsyncProjectsClient:
508
511
 
509
512
 
510
513
  async def main() -> None:
511
- await client.dubbing.projects.list()
514
+ await client.dubbing.projects.list(
515
+ limit=1,
516
+ next="next",
517
+ )
512
518
 
513
519
 
514
520
  asyncio.run(main())
@@ -0,0 +1,58 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from __future__ import annotations
4
+
5
+
6
+ class MurfEnvironment:
7
+ DEFAULT: MurfEnvironment
8
+
9
+ def __init__(
10
+ self,
11
+ *,
12
+ base: str,
13
+ global_router: str,
14
+ us_east: str,
15
+ us_west: str,
16
+ india: str,
17
+ canada: str,
18
+ south_korea: str,
19
+ uae: str,
20
+ japan: str,
21
+ australia: str,
22
+ eu_central: str,
23
+ uk: str,
24
+ south_america: str,
25
+ production: str,
26
+ ):
27
+ self.base = base
28
+ self.global_router = global_router
29
+ self.us_east = us_east
30
+ self.us_west = us_west
31
+ self.india = india
32
+ self.canada = canada
33
+ self.south_korea = south_korea
34
+ self.uae = uae
35
+ self.japan = japan
36
+ self.australia = australia
37
+ self.eu_central = eu_central
38
+ self.uk = uk
39
+ self.south_america = south_america
40
+ self.production = production
41
+
42
+
43
+ MurfEnvironment.DEFAULT = MurfEnvironment(
44
+ base="https://api.murf.ai",
45
+ global_router="https://global.api.murf.ai",
46
+ us_east="https://us-east.api.murf.ai",
47
+ us_west="https://us-west.api.murf.ai",
48
+ india="https://in.api.murf.ai",
49
+ canada="https://ca.api.murf.ai",
50
+ south_korea="https://kr.api.murf.ai",
51
+ uae="https://me.api.murf.ai",
52
+ japan="https://jp.api.murf.ai",
53
+ australia="https://au.api.murf.ai",
54
+ eu_central="https://eu-central.api.murf.ai",
55
+ uk="https://uk.api.murf.ai",
56
+ south_america="https://sa-east.api.murf.ai",
57
+ production="wss://global.api.murf.ai/v1/speech",
58
+ )
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from .types import ReceiveMessage, SendMessage, TextToSpeechModel
4
+
5
+ __all__ = ["ReceiveMessage", "SendMessage", "TextToSpeechModel"]
@@ -2,5 +2,6 @@
2
2
 
3
3
  from .receive_message import ReceiveMessage
4
4
  from .send_message import SendMessage
5
+ from .text_to_speech_model import TextToSpeechModel
5
6
 
6
- __all__ = ["ReceiveMessage", "SendMessage"]
7
+ __all__ = ["ReceiveMessage", "SendMessage", "TextToSpeechModel"]
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ TextToSpeechModel = typing.Union[typing.Literal["FALCON", "GEN2"], typing.Any]
@@ -2,7 +2,6 @@
2
2
 
3
3
  import typing
4
4
  from ..core.client_wrapper import SyncClientWrapper
5
- from .types.generate_speech_request_model_version import GenerateSpeechRequestModelVersion
6
5
  from ..types.pronunciation_detail import PronunciationDetail
7
6
  from ..core.request_options import RequestOptions
8
7
  from ..types.generate_speech_response import GenerateSpeechResponse
@@ -34,9 +33,8 @@ class TextToSpeechClient:
34
33
  audio_duration: typing.Optional[float] = OMIT,
35
34
  channel_type: typing.Optional[str] = OMIT,
36
35
  encode_as_base_64: typing.Optional[bool] = OMIT,
37
- encoded_as_base_64_with_zero_retention: typing.Optional[bool] = OMIT,
38
36
  format: typing.Optional[str] = OMIT,
39
- model_version: typing.Optional[GenerateSpeechRequestModelVersion] = OMIT,
37
+ model_version: typing.Optional[typing.Literal["GEN2"]] = OMIT,
40
38
  multi_native_locale: typing.Optional[str] = OMIT,
41
39
  pitch: typing.Optional[int] = OMIT,
42
40
  pronunciation_dictionary: typing.Optional[typing.Dict[str, PronunciationDetail]] = OMIT,
@@ -65,16 +63,13 @@ class TextToSpeechClient:
65
63
  Valid values: STEREO, MONO
66
64
 
67
65
  encode_as_base_64 : typing.Optional[bool]
68
- Set to true to receive audio in response as a Base64 encoded string instead of a url.
69
-
70
- encoded_as_base_64_with_zero_retention : typing.Optional[bool]
71
- Set to true to receive audio in response as a Base64 encoded string with zero data retention
66
+ Set to true to receive audio in response as a Base64 encoded string instead of a url. This enables zero retention of audio data on Murf's servers.
72
67
 
73
68
  format : typing.Optional[str]
74
69
  Format of the generated audio file. Valid values: MP3, WAV, FLAC, ALAW, ULAW, PCM, OGG
75
70
 
76
- model_version : typing.Optional[GenerateSpeechRequestModelVersion]
77
- Valid values: GEN1, GEN2. Use GEN2 to generate audio using new and advanced model. Outputs from Gen 2 will sound better, but different from the old model
71
+ model_version : typing.Optional[typing.Literal["GEN2"]]
72
+ Valid values: GEN2. Audio will be generated using the new and advanced GEN2 model. Outputs from GEN2 sound more natural and high-quality compared to earlier models.
78
73
 
79
74
  multi_native_locale : typing.Optional[str]
80
75
  Specifies the language for the generated audio, enabling a voice to speak in multiple languages natively. Only available in the Gen2 model.
@@ -121,7 +116,7 @@ class TextToSpeechClient:
121
116
  api_key="YOUR_API_KEY",
122
117
  )
123
118
  client.text_to_speech.generate(
124
- text="Hello, world!",
119
+ text="Hi, How are you doing today?",
125
120
  voice_id="en-US-natalie",
126
121
  )
127
122
  """
@@ -133,7 +128,6 @@ class TextToSpeechClient:
133
128
  "audioDuration": audio_duration,
134
129
  "channelType": channel_type,
135
130
  "encodeAsBase64": encode_as_base_64,
136
- "encodedAsBase64WithZeroRetention": encoded_as_base_64_with_zero_retention,
137
131
  "format": format,
138
132
  "modelVersion": model_version,
139
133
  "multiNativeLocale": multi_native_locale,
@@ -226,6 +220,7 @@ class TextToSpeechClient:
226
220
  *,
227
221
  text: str,
228
222
  voice_id: str,
223
+ model: typing.Optional[str] = OMIT,
229
224
  channel_type: typing.Optional[str] = OMIT,
230
225
  format: typing.Optional[str] = OMIT,
231
226
  multi_native_locale: typing.Optional[str] = OMIT,
@@ -238,7 +233,24 @@ class TextToSpeechClient:
238
233
  request_options: typing.Optional[RequestOptions] = None,
239
234
  ) -> typing.Iterator[bytes]:
240
235
  """
241
- Returns a streaming output of generated audio
236
+ Synthesize speech with ultra-low latency over a streaming connection.
237
+ Choose the `Base URL` from the URL dropdown (Global URL or a pinned Region)
238
+
239
+ **Note**: Global URL auto-routes to the nearest region.
240
+ | Region | URL | Default Concurrency |
241
+ | ------------------------- | ---------------------------------------------- | -------------------- |
242
+ | Global (Routes to the nearest server) | `https://global.api.murf.ai/v1/speech/stream` | Region specific concurrency |
243
+ | US-East | `https://us-east.api.murf.ai/v1/speech/stream` | 15 |
244
+ | US-West | `https://us-west.api.murf.ai/v1/speech/stream` | 2 |
245
+ | India | `https://in.api.murf.ai/v1/speech/stream` | 2 |
246
+ | Canada | `https://ca.api.murf.ai/v1/speech/stream` | 2 |
247
+ | South Korea | `https://kr.api.murf.ai/v1/speech/stream` | 2 |
248
+ | UAE | `https://me.api.murf.ai/v1/speech/stream` | 2 |
249
+ | Japan | `https://jp.api.murf.ai/v1/speech/stream` | 2 |
250
+ | Australia | `https://au.api.murf.ai/v1/speech/stream` | 2 |
251
+ | EU (Central) | `https://eu-central.api.murf.ai/v1/speech/stream` | 2 |
252
+ | UK | `https://uk.api.murf.ai/v1/speech/stream` | 2 |
253
+ | South America (São Paulo) | `https://sa-east.api.murf.ai/v1/speech/stream` | 2 |
242
254
 
243
255
  Parameters
244
256
  ----------
@@ -248,14 +260,17 @@ class TextToSpeechClient:
248
260
  voice_id : str
249
261
  Use the GET /v1/speech/voices API to find supported voiceIds. You can use either the voiceId (e.g. en-US-natalie) or just the voice actor's name (e.g. natalie).
250
262
 
263
+ model : typing.Optional[str]
264
+ The model to use for audio output. Defaults to FALCON for all the regions except US-East. Valid values: FALCON, GEN2
265
+
251
266
  channel_type : typing.Optional[str]
252
267
  Valid values: STEREO, MONO
253
268
 
254
269
  format : typing.Optional[str]
255
- Format of the generated audio file. Valid values: MP3, WAV, PCM
270
+ Format of the generated audio file.Valid values: MP3, FLAC, WAV, ALAW, ULAW, OGG, PCM
256
271
 
257
272
  multi_native_locale : typing.Optional[str]
258
- Specifies the language for the generated audio, enabling a voice to speak in multiple languages natively. Only available in the Gen2 model.
273
+ Specifies the language for the generated audio, enabling a voice to speak in multiple languages natively.
259
274
  Valid values: "en-US", "en-UK", "es-ES", etc. Use the GET /v1/speech/voices endpoint to retrieve the list of available voices and languages.
260
275
 
261
276
  pitch : typing.Optional[int]
@@ -272,7 +287,7 @@ class TextToSpeechClient:
272
287
  Speed of the voiceover
273
288
 
274
289
  sample_rate : typing.Optional[float]
275
- Valid values are 8000, 24000, 44100, 48000
290
+ Valid values are 8000, 24000, 44100, 48000. Defaults to 24000 for Falcon model and 44100 for Gen2 model.
276
291
 
277
292
  style : typing.Optional[str]
278
293
  The voice style to be used for voiceover generation.
@@ -295,13 +310,17 @@ class TextToSpeechClient:
295
310
  client = Murf(
296
311
  api_key="YOUR_API_KEY",
297
312
  )
298
- client.text_to_speech.stream()
313
+ client.text_to_speech.stream(
314
+ text="text",
315
+ voice_id="voiceId",
316
+ )
299
317
  """
300
318
  with self._client_wrapper.httpx_client.stream(
301
319
  "v1/speech/stream",
302
- base_url=self._client_wrapper.get_environment().base,
320
+ base_url=self._client_wrapper.get_environment().global_router,
303
321
  method="POST",
304
322
  json={
323
+ "model": model,
305
324
  "channelType": channel_type,
306
325
  "format": format,
307
326
  "multiNativeLocale": multi_native_locale,
@@ -411,7 +430,9 @@ class TextToSpeechClient:
411
430
  client = Murf(
412
431
  api_key="YOUR_API_KEY",
413
432
  )
414
- client.text_to_speech.get_voices()
433
+ client.text_to_speech.get_voices(
434
+ token="token",
435
+ )
415
436
  """
416
437
  _response = self._client_wrapper.httpx_client.request(
417
438
  "v1/speech/voices",
@@ -489,9 +510,8 @@ class AsyncTextToSpeechClient:
489
510
  audio_duration: typing.Optional[float] = OMIT,
490
511
  channel_type: typing.Optional[str] = OMIT,
491
512
  encode_as_base_64: typing.Optional[bool] = OMIT,
492
- encoded_as_base_64_with_zero_retention: typing.Optional[bool] = OMIT,
493
513
  format: typing.Optional[str] = OMIT,
494
- model_version: typing.Optional[GenerateSpeechRequestModelVersion] = OMIT,
514
+ model_version: typing.Optional[typing.Literal["GEN2"]] = OMIT,
495
515
  multi_native_locale: typing.Optional[str] = OMIT,
496
516
  pitch: typing.Optional[int] = OMIT,
497
517
  pronunciation_dictionary: typing.Optional[typing.Dict[str, PronunciationDetail]] = OMIT,
@@ -520,16 +540,13 @@ class AsyncTextToSpeechClient:
520
540
  Valid values: STEREO, MONO
521
541
 
522
542
  encode_as_base_64 : typing.Optional[bool]
523
- Set to true to receive audio in response as a Base64 encoded string instead of a url.
524
-
525
- encoded_as_base_64_with_zero_retention : typing.Optional[bool]
526
- Set to true to receive audio in response as a Base64 encoded string with zero data retention
543
+ Set to true to receive audio in response as a Base64 encoded string instead of a url. This enables zero retention of audio data on Murf's servers.
527
544
 
528
545
  format : typing.Optional[str]
529
546
  Format of the generated audio file. Valid values: MP3, WAV, FLAC, ALAW, ULAW, PCM, OGG
530
547
 
531
- model_version : typing.Optional[GenerateSpeechRequestModelVersion]
532
- Valid values: GEN1, GEN2. Use GEN2 to generate audio using new and advanced model. Outputs from Gen 2 will sound better, but different from the old model
548
+ model_version : typing.Optional[typing.Literal["GEN2"]]
549
+ Valid values: GEN2. Audio will be generated using the new and advanced GEN2 model. Outputs from GEN2 sound more natural and high-quality compared to earlier models.
533
550
 
534
551
  multi_native_locale : typing.Optional[str]
535
552
  Specifies the language for the generated audio, enabling a voice to speak in multiple languages natively. Only available in the Gen2 model.
@@ -581,7 +598,7 @@ class AsyncTextToSpeechClient:
581
598
 
582
599
  async def main() -> None:
583
600
  await client.text_to_speech.generate(
584
- text="Hello, world!",
601
+ text="Hi, How are you doing today?",
585
602
  voice_id="en-US-natalie",
586
603
  )
587
604
 
@@ -596,7 +613,6 @@ class AsyncTextToSpeechClient:
596
613
  "audioDuration": audio_duration,
597
614
  "channelType": channel_type,
598
615
  "encodeAsBase64": encode_as_base_64,
599
- "encodedAsBase64WithZeroRetention": encoded_as_base_64_with_zero_retention,
600
616
  "format": format,
601
617
  "modelVersion": model_version,
602
618
  "multiNativeLocale": multi_native_locale,
@@ -689,6 +705,7 @@ class AsyncTextToSpeechClient:
689
705
  *,
690
706
  text: str,
691
707
  voice_id: str,
708
+ model: typing.Optional[str] = OMIT,
692
709
  channel_type: typing.Optional[str] = OMIT,
693
710
  format: typing.Optional[str] = OMIT,
694
711
  multi_native_locale: typing.Optional[str] = OMIT,
@@ -701,7 +718,24 @@ class AsyncTextToSpeechClient:
701
718
  request_options: typing.Optional[RequestOptions] = None,
702
719
  ) -> typing.AsyncIterator[bytes]:
703
720
  """
704
- Returns a streaming output of generated audio
721
+ Synthesize speech with ultra-low latency over a streaming connection.
722
+ Choose the `Base URL` from the URL dropdown (Global URL or a pinned Region)
723
+
724
+ **Note**: Global URL auto-routes to the nearest region.
725
+ | Region | URL | Default Concurrency |
726
+ | ------------------------- | ---------------------------------------------- | -------------------- |
727
+ | Global (Routes to the nearest server) | `https://global.api.murf.ai/v1/speech/stream` | Region specific concurrency |
728
+ | US-East | `https://us-east.api.murf.ai/v1/speech/stream` | 15 |
729
+ | US-West | `https://us-west.api.murf.ai/v1/speech/stream` | 2 |
730
+ | India | `https://in.api.murf.ai/v1/speech/stream` | 2 |
731
+ | Canada | `https://ca.api.murf.ai/v1/speech/stream` | 2 |
732
+ | South Korea | `https://kr.api.murf.ai/v1/speech/stream` | 2 |
733
+ | UAE | `https://me.api.murf.ai/v1/speech/stream` | 2 |
734
+ | Japan | `https://jp.api.murf.ai/v1/speech/stream` | 2 |
735
+ | Australia | `https://au.api.murf.ai/v1/speech/stream` | 2 |
736
+ | EU (Central) | `https://eu-central.api.murf.ai/v1/speech/stream` | 2 |
737
+ | UK | `https://uk.api.murf.ai/v1/speech/stream` | 2 |
738
+ | South America (São Paulo) | `https://sa-east.api.murf.ai/v1/speech/stream` | 2 |
705
739
 
706
740
  Parameters
707
741
  ----------
@@ -711,14 +745,17 @@ class AsyncTextToSpeechClient:
711
745
  voice_id : str
712
746
  Use the GET /v1/speech/voices API to find supported voiceIds. You can use either the voiceId (e.g. en-US-natalie) or just the voice actor's name (e.g. natalie).
713
747
 
748
+ model : typing.Optional[str]
749
+ The model to use for audio output. Defaults to FALCON for all the regions except US-East. Valid values: FALCON, GEN2
750
+
714
751
  channel_type : typing.Optional[str]
715
752
  Valid values: STEREO, MONO
716
753
 
717
754
  format : typing.Optional[str]
718
- Format of the generated audio file. Valid values: MP3, WAV, PCM
755
+ Format of the generated audio file.Valid values: MP3, FLAC, WAV, ALAW, ULAW, OGG, PCM
719
756
 
720
757
  multi_native_locale : typing.Optional[str]
721
- Specifies the language for the generated audio, enabling a voice to speak in multiple languages natively. Only available in the Gen2 model.
758
+ Specifies the language for the generated audio, enabling a voice to speak in multiple languages natively.
722
759
  Valid values: "en-US", "en-UK", "es-ES", etc. Use the GET /v1/speech/voices endpoint to retrieve the list of available voices and languages.
723
760
 
724
761
  pitch : typing.Optional[int]
@@ -735,7 +772,7 @@ class AsyncTextToSpeechClient:
735
772
  Speed of the voiceover
736
773
 
737
774
  sample_rate : typing.Optional[float]
738
- Valid values are 8000, 24000, 44100, 48000
775
+ Valid values are 8000, 24000, 44100, 48000. Defaults to 24000 for Falcon model and 44100 for Gen2 model.
739
776
 
740
777
  style : typing.Optional[str]
741
778
  The voice style to be used for voiceover generation.
@@ -763,16 +800,20 @@ class AsyncTextToSpeechClient:
763
800
 
764
801
 
765
802
  async def main() -> None:
766
- await client.text_to_speech.stream()
803
+ await client.text_to_speech.stream(
804
+ text="text",
805
+ voice_id="voiceId",
806
+ )
767
807
 
768
808
 
769
809
  asyncio.run(main())
770
810
  """
771
811
  async with self._client_wrapper.httpx_client.stream(
772
812
  "v1/speech/stream",
773
- base_url=self._client_wrapper.get_environment().base,
813
+ base_url=self._client_wrapper.get_environment().global_router,
774
814
  method="POST",
775
815
  json={
816
+ "model": model,
776
817
  "channelType": channel_type,
777
818
  "format": format,
778
819
  "multiNativeLocale": multi_native_locale,
@@ -887,7 +928,9 @@ class AsyncTextToSpeechClient:
887
928
 
888
929
 
889
930
  async def main() -> None:
890
- await client.text_to_speech.get_voices()
931
+ await client.text_to_speech.get_voices(
932
+ token="token",
933
+ )
891
934
 
892
935
 
893
936
  asyncio.run(main())
@@ -3,8 +3,8 @@
3
3
  from ..core.unchecked_base_model import UncheckedBaseModel
4
4
  import typing_extensions
5
5
  from ..core.serialization import FieldMetadata
6
- import pydantic
7
6
  import typing
7
+ import pydantic
8
8
  from .word_duration_response import WordDurationResponse
9
9
  from ..core.pydantic_utilities import IS_PYDANTIC_V2
10
10
 
@@ -12,9 +12,9 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2
12
12
  class GenerateSpeechResponse(UncheckedBaseModel):
13
13
  audio_file: typing_extensions.Annotated[str, FieldMetadata(alias="audioFile")]
14
14
  audio_length_in_seconds: typing_extensions.Annotated[float, FieldMetadata(alias="audioLengthInSeconds")]
15
- consumed_character_count: typing_extensions.Annotated[int, FieldMetadata(alias="consumedCharacterCount")] = (
16
- pydantic.Field()
17
- )
15
+ consumed_character_count: typing_extensions.Annotated[
16
+ typing.Optional[int], FieldMetadata(alias="consumedCharacterCount")
17
+ ] = pydantic.Field(default=None)
18
18
  """
19
19
  Number of characters consumed so far in the current billing cycle.
20
20
  """
@@ -42,7 +42,7 @@ class SendTextVoiceConfig(UncheckedBaseModel):
42
42
 
43
43
  multi_native_locale: typing.Optional[str] = pydantic.Field(default=None)
44
44
  """
45
- Specifies the language for the generated audio, enabling a voice to speak in multiple languages natively. Only available in the Gen2 model. Valid values: "en-US", "en-UK", "es-ES", etc. Use the GET /v1/speed/voices endpoint to retrieve the list of available voices and languages.
45
+ Specifies the language for the generated audio, enabling a voice to speak in multiple languages natively. Valid values: "en-US", "en-UK", "es-ES", etc. Use the GET /v1/speed/voices endpoint to retrieve the list of available voices and languages.
46
46
  """
47
47
 
48
48
  if IS_PYDANTIC_V2:
@@ -44,7 +44,7 @@ class SetVoiceConfigurationOrInitializeContextVoiceConfig(UncheckedBaseModel):
44
44
 
45
45
  multi_native_locale: typing.Optional[str] = pydantic.Field(default=None)
46
46
  """
47
- Specifies the language for the generated audio, enabling a voice to speak in multiple languages natively. Only available in the Gen2 model. Valid values: "en-US", "en-UK", "es-ES", etc. Use the GET /v1/speed/voices endpoint to retrieve the list of available voices and languages.
47
+ Specifies the language for the generated audio, enabling a voice to speak in multiple languages natively. Valid values: "en-US", "en-UK", "es-ES", etc. Use the GET /v1/speed/voices endpoint to retrieve the list of available voices and languages.
48
48
  """
49
49
 
50
50
  if IS_PYDANTIC_V2:
@@ -0,0 +1,2 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
@@ -1,14 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- from __future__ import annotations
4
-
5
-
6
- class MurfEnvironment:
7
- DEFAULT: MurfEnvironment
8
-
9
- def __init__(self, *, base: str, production: str):
10
- self.base = base
11
- self.production = production
12
-
13
-
14
- MurfEnvironment.DEFAULT = MurfEnvironment(base="https://api.murf.ai", production="wss://api.murf.ai/v1/speech")
@@ -1,5 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- from .types import ReceiveMessage, SendMessage
4
-
5
- __all__ = ["ReceiveMessage", "SendMessage"]
@@ -1,5 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- from .types import GenerateSpeechRequestModelVersion
4
-
5
- __all__ = ["GenerateSpeechRequestModelVersion"]
@@ -1,5 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- from .generate_speech_request_model_version import GenerateSpeechRequestModelVersion
4
-
5
- __all__ = ["GenerateSpeechRequestModelVersion"]
@@ -1,5 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- import typing
4
-
5
- GenerateSpeechRequestModelVersion = typing.Union[typing.Literal["GEN1", "GEN2"], typing.Any]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes