Skip to content

Commit c9420db

Browse files
committed
Accept model parameter when synthesizing speech
1 parent 4595ca5 commit c9420db

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lmnt/api.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,10 @@ async def synthesize(self, text: str, voice: str, **kwargs):
313313
- `voice` (str): The voice id to use for synthesis.
314314
315315
Optional parameters:
316+
- `model` (str): The name of the model to use. Defaults to `aurora`.
316317
- `seed` (int): The seed used to specify a different take. Defaults to random.
317318
- `format` (str): The audio format to use for synthesis. Defaults to `mp3`.
318-
- `sample_rate` (int): 8000, 16000, or 24000 – the desired output sample rate. Defaults to 24000 for all formats except `mulaw` which defaults to 8000.
319+
- `sample_rate` (int): 8000, 16000, or 24000 - the desired output sample rate. Defaults to 24000 for all formats except `mulaw` which defaults to 8000.
319320
- `speed` (float): Floating point value between 0.25 (slow) and 2.0 (fast); Defaults to 1.0
320321
- `return_durations` (bool): If `True`, the response will include word durations detail. Defaults to `False`.
321322
- `return_seed` (bool): If `True`, the response will include the seed used for synthesis. Defaults to `False`.
@@ -351,6 +352,7 @@ async def synthesize(self, text: str, voice: str, **kwargs):
351352
form_data.add_field('seed', kwargs.get('seed'))
352353
form_data.add_field('format', kwargs.get('format', 'mp3'))
353354
form_data.add_field('speed', kwargs.get('speed', 1.0))
355+
form_data.add_field('model', kwargs.get('model', 'aurora'))
354356
length = kwargs.get('length', None)
355357
if length is not None:
356358
form_data.add_field('length', length)
@@ -368,6 +370,7 @@ async def synthesize(self, text: str, voice: str, **kwargs):
368370
form_data.add_field('language', kwargs.get('language'))
369371
if 'conversational' in kwargs:
370372
form_data.add_field('conversational', kwargs.get('conversational'))
373+
371374
async with self._session.post(url, data=form_data, headers=self._build_headers()) as resp:
372375
await self._handle_response_errors(resp, 'Speech.synthesize')
373376
response_data = await resp.json()

0 commit comments

Comments
 (0)