API for Subtitle Dubbing
03-06-2024 ,
03-06-2024
SpeechGen allows dubbing subtitles for videos using neural networks, converting text into voice for video dubbing in any language. It is possible to do this not only through the interface, but also through the API.
URL for Request
For subtitle dubbing, use the following URL:
https://speechgen.io/index.php?r=api/subs
Request Format
The request should contain the following parameters:
{
'token': '1234567890',
'email': 'mail@gmail.com',
'voice': 'Angel',
'text': "sub text",
'format': 'mp3',
'speed': 1,
'pitch': 0,
'speed_floor': 300,
'speed_type': 2,
'bitrate': 16000,
'emotion': 'good'
}
Required Parameters:
- token - Your secret key.
- email - Your email address.
- voice - The voice for dubbing.
- text - The subtitle text.
Optional Parameters:
- format - Output file format (default is mp3). Possible values: mp3, wav, ogg.
- speed - Playback speed (default is 1, range from 0.1 to 2.0).
- pitch - Voice pitch (default is 0, range from -20 to 20).
- speed_floor - Minimum speed (default is 300).
- speed_type - Speed type (default is 2). Speed up only - is 1. Speed up and slow down - is 2.
- bitrate - Bitrate (default is 16000, range from 8000 to 192000 Hz).
- emotion - Voice emotion (default is 'good', possible values: good, evil, neutral).
Getting the Result
To get the result, use the following URL:
https://speechgen.io/index.php?r=api/result
Request format:
{
'token': '1234567890',
'email': 'mail@gmail.com',
'id': 4153594
}
Response Fields Description
- id - Unique dubbing identifier.
- status - Current dubbing status: 0 - in process, 1 - completed successfully, -1 - error.
- file - Audio file path (available if status = 1).
- error - Error text (if status = -1).
- parts - Number of dubbings.
- parts_done - Number of completed parts.
- duration - Audio file duration in seconds (available if status = 1).
- format - Audio file format.
- balans - Account balance.
- cost - Dubbing cost.