Add GET and POST apis to swagger
This commit is contained in:
parent
c6e218fdae
commit
7bdf0fda29
2 changed files with 79 additions and 16 deletions
|
|
@ -13,13 +13,6 @@ paths:
|
||||||
get:
|
get:
|
||||||
summary: 'Speak text to WAV'
|
summary: 'Speak text to WAV'
|
||||||
parameters:
|
parameters:
|
||||||
- in: query
|
|
||||||
name: voice
|
|
||||||
required: true
|
|
||||||
description: 'Voice in the form <lang>/<name>_<quality> optional with #<speaker> at the end'
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
example: 'en_UK/apope_low'
|
|
||||||
- in: query
|
- in: query
|
||||||
name: text
|
name: text
|
||||||
required: true
|
required: true
|
||||||
|
|
@ -27,6 +20,84 @@ paths:
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
example: 'Welcome to the world of speech synthesis!'
|
example: 'Welcome to the world of speech synthesis!'
|
||||||
|
- in: query
|
||||||
|
name: voice
|
||||||
|
description: 'Voice in the form <lang>/<name>_<quality> optional with #<speaker> at the end'
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
example: 'en_UK/apope_low'
|
||||||
|
- in: query
|
||||||
|
name: noiseScale
|
||||||
|
description: 'Volatility of speaker (0-1, default: 0.667)'
|
||||||
|
schema:
|
||||||
|
type: number
|
||||||
|
example: 0.667
|
||||||
|
- in: query
|
||||||
|
name: noiseW
|
||||||
|
description: 'Volatility of individual phonemes (0-1, default: 0.667)'
|
||||||
|
schema:
|
||||||
|
type: number
|
||||||
|
example: 0.8
|
||||||
|
- in: query
|
||||||
|
name: lengthScale
|
||||||
|
description: 'Speed of speaker (default: 1.0, faster < 1 < slower)'
|
||||||
|
schema:
|
||||||
|
type: number
|
||||||
|
example: 1.0
|
||||||
|
- in: query
|
||||||
|
name: ssml
|
||||||
|
description: 'Input text is SSML'
|
||||||
|
schema:
|
||||||
|
type: boolean
|
||||||
|
example: false
|
||||||
|
produces:
|
||||||
|
- audio/wav
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: audio
|
||||||
|
schema:
|
||||||
|
type: binary
|
||||||
|
post:
|
||||||
|
summary: 'Speak text to WAV'
|
||||||
|
requestBody:
|
||||||
|
required: true
|
||||||
|
description: 'Text to speak'
|
||||||
|
content:
|
||||||
|
text/plain:
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
example: 'Welcome to the world of speech synthesis!'
|
||||||
|
parameters:
|
||||||
|
- in: query
|
||||||
|
name: voice
|
||||||
|
description: 'Voice in the form <lang>/<name>_<quality> optional with #<speaker> at the end'
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
example: 'en_UK/apope_low'
|
||||||
|
- in: query
|
||||||
|
name: noiseScale
|
||||||
|
description: 'Volatility of speaker (0-1, default: 0.667)'
|
||||||
|
schema:
|
||||||
|
type: number
|
||||||
|
example: 0.667
|
||||||
|
- in: query
|
||||||
|
name: noiseW
|
||||||
|
description: 'Volatility of individual phonemes (0-1, default: 0.667)'
|
||||||
|
schema:
|
||||||
|
type: number
|
||||||
|
example: 0.8
|
||||||
|
- in: query
|
||||||
|
name: lengthScale
|
||||||
|
description: 'Speed of speaker (default: 1.0, faster < 1 < slower)'
|
||||||
|
schema:
|
||||||
|
type: number
|
||||||
|
example: 1.0
|
||||||
|
- in: query
|
||||||
|
name: ssml
|
||||||
|
description: 'Input text is SSML'
|
||||||
|
schema:
|
||||||
|
type: boolean
|
||||||
|
example: false
|
||||||
produces:
|
produces:
|
||||||
- audio/wav
|
- audio/wav
|
||||||
responses:
|
responses:
|
||||||
|
|
|
||||||
|
|
@ -90,12 +90,6 @@
|
||||||
<input type="number" id="length-scale" name="lengthScale" size="5" min="0" step="0.001" value="1">
|
<input type="number" id="length-scale" name="lengthScale" size="5" min="0" step="0.001" value="1">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row mt-3">
|
|
||||||
<div class="col-auto">
|
|
||||||
<label for="text-language" title="Text Language">Text Language:</label>
|
|
||||||
<input type="text" id="text-language" name="textLanguage" size="8" placeholder="lang code">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<hr class="mt-5" />
|
<hr class="mt-5" />
|
||||||
<div class="row mt-5 justify-content-center">
|
<div class="row mt-5 justify-content-center">
|
||||||
<a href="https://mycroft.ai" title="Mycroft AI">
|
<a href="https://mycroft.ai" title="Mycroft AI">
|
||||||
|
|
@ -142,7 +136,6 @@
|
||||||
voice = voice + "#" + speaker
|
voice = voice + "#" + speaker
|
||||||
}
|
}
|
||||||
|
|
||||||
var textLanguage = q('#text-language').value || ''
|
|
||||||
var ssml = q('#ssml').value || 'false'
|
var ssml = q('#ssml').value || 'false'
|
||||||
|
|
||||||
q('#audio-message').hidden = false
|
q('#audio-message').hidden = false
|
||||||
|
|
@ -155,8 +148,7 @@
|
||||||
'&noiseScale=' + encodeURIComponent(noiseScale) +
|
'&noiseScale=' + encodeURIComponent(noiseScale) +
|
||||||
'&noiseW=' + encodeURIComponent(noiseW) +
|
'&noiseW=' + encodeURIComponent(noiseW) +
|
||||||
'&lengthScale=' + encodeURIComponent(lengthScale) +
|
'&lengthScale=' + encodeURIComponent(lengthScale) +
|
||||||
'&ssml=' + encodeURIComponent(ssml) +
|
'&ssml=' + encodeURIComponent(ssml),
|
||||||
'&textLanguage=' + encodeURIComponent(textLanguage),
|
|
||||||
{cache: 'no-cache'})
|
{cache: 'no-cache'})
|
||||||
|
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue