API-instruksjon for tekst til tale

API-en er bare tilgjengelig etter at du har finansiert kontoen din.

JSON API voices https://speechgen.io/index.php?r=api/voices.

There are 2 text voiceover options available via the API:

1 option - quick voice-over of short texts.
2 option - setting a voice-over task.

1 option - quick voice-over of short texts

Url for variant 1: https://speechgen.io/index.php?r=api/text

Text is sent to the API, you get immediate results.

This option has a maximum limit of 2000 characters. And also a maximum of 2 voice changes. If the limits are exceeded, you will get an error (status = -1).

Request format

$data = [
	'token'=>'SekretKeyInYourProfile',
	'email'=>'yourMail@gmail.com',
	'voice'=>'John',
	'text'=>"Text for text to Speech", 
	'format'=>'mp3',
	'speed'=>1.1, 
	'pitch'=>0.8,   
	'emotion'=>'good', 
	];

Mandatory parameters:

'token' - 'SekretKeyInYourProfile'
'email' - 'yourMail@gmail.com'
'voice' - 'Voice'
'text' - 'Text for text to Speech' 
 

Optional parameters:

'format' - format of the resulting file, by default = mp3, possible values ( 'mp3', 'wav', 'ogg')
'speed' - playback speed, by default 1, (range from  0.1 to 2.0) 
'pitch'- voice pitch, by default 0, (range from -20 to 20)    
'emotion' - emotion of voice , by default 'good', possible values ( 'good',  'evil', 'neutral'). 
Not available for all voices, look it here.

The answer comes in JSON:

{
"id":"4153594",
"status":"0",
"parts":"5",
"parts_done":"2",
"duration":"0",
"format":"mp3",
"error":"",
"balans":"3331.2720000314",
"cost":"0.06"
}

Description:

"id" - unique voice ID
"status" - current voiceover status. Available from 3 values:
    0  - process
    1  - completed successfully
    -1 - error 
"file" - audio file path, available if status= 1
"error" - error text, in the event of, if status =  -1
"parts"  - number of voiceovers
"parts_done" - number of pieces completed
"duration"  - audio file duration in seconds, available if status  = 1
"format" - audio file format
"balans" - limit balance
"cost" - voiceover costs. (is increased as the voice parts are dubbed)


 

Option 2 is to set a voice-over task for the text.

Url for option 2: https://speechgen.io/index.php?r=api/longtext

Step 1: Text is sent to the API and a unique voice ID is obtained(id).
Step 2:  Request the result of the dubbing by sending the dubbing identifier (id).

This method has no limitations and allows text dubbing of up to 1,000,000 characters. The dubbing takes place in order of priority (first come, first served) and can take from 1 to several minutes, depending on the length of the text.

Request format

$data = [
	'token'=>'SekretKeyInYourProfile',
	'email'=>'yourMail@gmail.com',
	'voice'=>'John',
	'text'=>"Text", 
	'format'=>'mp3',
	'speed'=>1.1, 
	'pitch'=>0.8,   
	'emotion'=>'good', 
	];

Mandatory parameters:

'token' - 'SekretKeyInYourProfile'
'email' - 'yourMail@gmail.com'
'voice' - 'Voice'
'text' - 'Text' 
 

Optional parameters:

'format' - format of the resulting file, by default = mp3, possible values( 'mp3', 'wav', 'ogg')
'speed' - speed, by default 1, (range from 0.1 to 2.0) 
'pitch'- voice pitch, by default 0, (range from -20 to 20)    
'emotion' - emotional coloration, by default  'good', possible values ( 'good',  'evil', 'neutral'). 
Not available for all voices, look here.

The response comes in JSON:

{
"id":"4153594",
"status":"0",
"parts":"5",
"parts_done":"0",
"format":"mp3",
"error":"",
"balans":"3331.2720000314",
"cost":"0.00"
}

Description:

"id" - unique voice ID
"status" - current voiceover status. Available from 2 values:
    1  - task added successfully
    -1 - error 
"error" - error text, in case of, if status =  -1
"parts"  - number of voiceovers
"parts_done" - number of pieces completed
"format" - audio file format
"balans" - the balance of the account limits
"cost" - voiceover costs. ( is increased as the voice parts are dubbed)
 

Step 2. After creating a task and obtaining an identifier (id), a request must be sent to https://speechgen.io/index.php?r=api/result, to find out the result.

Request format

$data = [
	'token'=>'SekretKeyInYourProfile',
	'email'=>'yourMail@gmail.com',
	'id'=>4153594, 
];

Mandatory parameters:

'token' - SekretKeyInYourProfile
'email' - yourMail@gmail.com
'id' - Unique voice ID obtained in step 1
 

The response comes in JSON:

{
"id":"4153594",
"status":"0",
"file":"result.mp3",
"cuts":["result_1.mp3","result_2.mp3",...],
"parts":"5",
"parts_done":"0",
"format":"mp3",
"error":"",
"balans":"3331.2720000314",
"cost":"0.00"
}

Description:

"id" - unique voice ID
"status" - current voiceover status. Available from 3 values:
    0  - in the midst of
    1  - completed successfully
    -1 - error 
"file" - audio file path, available if status = 1
"error" - error text, in case of, if status =  -1
"parts"  - number of voiceovers
"parts_done" - number of pieces completed
"duration"  - audio file duration in seconds, available if status = 1
"format" - audio file format
"balans" - the balance of the account limits
"cost" - voiceover costs. ( is increased as the voice parts are dubbed)
"cuts" - Array of fragments, if the "cut" tag is used in the text

 

Vi bruker informasjonskapsler for å sikre at du får den beste opplevelsen på nettstedet vårt. Finn ut mer: Personvernregler

Godta cookies