Hc_yandex_tts_clean

Команда сброса настроек Yandex TTS к значениям по умолчанию

Аналог команды в CoCon:

system/tts/yandex/clean

Метод HTTP-запроса:

POST

Шаблон HTTP-запроса:

http://host:port/commands/yandex_tts_clean

Код HTTP-ответа:

  • 200 – в случае успеха;
  • 404 – в случае ошибки.

XSD-схема XML-запроса/ответа:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:include schemaLocation="error.xsd" />

    <!-- in -->
    <xs:element name="in">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="request" >
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="voice" minOccurs="0" />
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <!-- out -->
    <xs:element name="out">
        <xs:complexType>
            <xs:choice>
                <xs:element name="response" />
                <xs:element name="error" type="errorType" />
            </xs:choice>
        </xs:complexType>
    </xs:element>
</xs:schema>
CODE

Пример:

Запрос:
http://192.168.1.21:9999/commands/yandex_tts_clean

<?xml version="1.0"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="yandex_tts_clean.xsd">
    <request>
        <voice/>
    </request>
</in>
CODE

Ответ:

200

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="yandex_tts_clean.xsd">
    <response/>
</out>
CODE

Hc_yandex_tts_info

Команда отображает текущие свойства Yandex TTS

Аналог команды в CoCon:

system/tts/yandex/info

Метод HTTP-запроса:

POST

Шаблон HTTP-запроса:

http://host:port/commands/yandex_tts_info

Код HTTP-ответа:

  • 200 – в случае успеха;
  • 404 – в случае ошибки.

XSD-схема XML-запроса/ответа:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:include schemaLocation="error.xsd" />

    <xs:complexType name="constType">
        <xs:attribute name="value" type="xs:string" use="required" />
    </xs:complexType>

    <xs:complexType name="voicesType">
        <xs:sequence>
            <xs:element name="voice" type="constType" maxOccurs="unbounded" />
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="langsType">
        <xs:sequence>
            <xs:element name="lang" type="constType" maxOccurs="unbounded" />
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="emotionsType">
        <xs:sequence>
            <xs:element name="emotion" type="constType" maxOccurs="unbounded" />
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="infoType">
        <xs:all>
            <xs:element name="voices" type="voicesType" />
            <xs:element name="langs" type="langsType" />
            <xs:element name="emotions" type="emotionsType" />
        </xs:all>
    </xs:complexType>

    <!-- in -->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="request" />
            </xs:all>
        </xs:complexType>
    </xs:element>
    <!-- out -->
    <xs:element name="out">
        <xs:complexType>
            <xs:choice>
                <xs:element name="response" type="infoType" />
                <xs:element name="error" type="errorType" />
            </xs:choice>
        </xs:complexType>
    </xs:element>
</xs:schema>

CODE

Пример:

Запрос:
http://192.168.1.21:9999/commands/yandex_tts_info

<?xml version="1.0"?>
<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="yandex_tts_info.xsd">
    <request/>
</in>
CODE

Ответ:

200

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="yandex_tts_info.xsd">
    <response>
        <voices>
            <voice value="oksana"/>
            <voice value="jane"/>
            <voice value="omazh"/>
            <voice value="zahar"/>
            <voice value="ermil"/>
            <voice value="silaerkan"/>
            <voice value="erkanyavas"/>
            <voice value="alyss"/>
            <voice value="nick"/>
            <voice value="alena"/>
            <voice value="filipp"/>
        </voices>
        <langs>
            <lang value="ru-RU"/>
            <lang value="en-US"/>
            <lang value="tr-TR"/>
        </langs>
        <emotions>
            <emotion value="good"/>
            <emotion value="evil"/>
            <emotion value="neutral"/>
        </emotions>
    </response>
</out>
CODE

Hc_yandex_tts_set

Команда установки параметров Yandex TTS

Аналог команды в CoCon:

system/tts/yandex/set

Метод HTTP-запроса:

POST

Шаблон HTTP-запроса:

http://host:port/commands/yandex_tts_set

Код HTTP-ответа:

  • 200 – в случае успеха;
  • 404 – в случае ошибки.

XSD-схема XML-запроса/ответа:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:include schemaLocation="error.xsd" />

    <xs:complexType name="constType">
        <xs:attribute name="value" type="xs:string" use="required" />
    </xs:complexType>

    <xs:complexType name="voiceSequenceType">
        <xs:sequence>
            <xs:element name="voice" type="constType" maxOccurs="unbounded" minOccurs="0" />
        </xs:sequence>
    </xs:complexType>

    <!-- in -->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="request">
                    <xs:complexType>
                        <xs:all>
                            <xs:element name="add" minOccurs="0" maxOccurs="1" type="voiceSequenceType" />
                            <xs:element name="remove" minOccurs="0" maxOccurs="1" type="voiceSequenceType" />
                        </xs:all>
                    </xs:complexType>
                </xs:element>
            </xs:all>
        </xs:complexType>
    </xs:element>

    <!-- out -->
    <xs:element name="out">
        <xs:complexType>
            <xs:choice>
                <xs:element name="response">
                    <xs:complexType>
                        <xs:all>
                            <xs:element minOccurs="0" name="added" type="voiceSequenceType" />
                            <xs:element minOccurs="0" name="not-added" type="voiceSequenceType" />
                            <xs:element minOccurs="0" name="remove" type="voiceSequenceType" />
                            <xs:element minOccurs="0" name="not-removed" type="voiceSequenceType" />
                            <xs:element minOccurs="0" name="voices" type="voiceSequenceType" />
                        </xs:all>
                    </xs:complexType>
                </xs:element>
                <xs:element name="error" type="errorType" />
            </xs:choice>
        </xs:complexType>
    </xs:element>
</xs:schema>
CODE

Пример:

Запрос:
http://192.168.1.21:9999/commands/yandex_tts_set

<?xml version="1.0"?>
<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="yandex_tts_set.xsd">
    <request>
        <add>
            <voice value="sveta"/>
            <voice value="masha"/>
        </add>
        <remove>
            <voice value="erkanyavas"/>
        </remove>
    </request>
</in>
CODE

Ответ:

200

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="yandex_tts_set.xsd">
    <response>
        <voices>
            <voice value="alena"/>
            <voice value="alyss"/>
            <voice value="ermil"/>
            <voice value="filipp"/>
            <voice value="jane"/>
            <voice value="masha"/>
            <voice value="nick"/>
            <voice value="oksana"/>
            <voice value="omazh"/>
            <voice value="silaerkan"/>
            <voice value="sveta"/>
            <voice value="zahar"/>
        </voices>
        <remove>
            <voice value="erkanyavas"/>
        </remove>
        <not-removed/>
        <not-added/>
        <added>
            <voice value="masha"/>
            <voice value="sveta"/>
        </added>
    </response>
</out>
CODE