Coroutine-native client covering the full Hanzo /v1 cloud surface, for JVM and Android. Generated with openapi-generator kotlin (library=jvm-okhttp4, useCoroutines=true). Coordinate: ai.hanzo:sdk. Base URL: https://api.hanzo.ai. Co-authored-by: Hanzo Dev <[email protected]>
6.7 KiB
TTSAPIApi
All URIs are relative to https://api.hanzo.ai
| Method | HTTP request | Description |
|---|---|---|
| cloudApiControllerGenerateTextToSpeechAudio | POST /v1/cloud/generate-text-to-speech-audio | Api Controller Generate Text To Speech Audio |
| cloudApiControllerGenerateTextToSpeechAudioStream | GET /v1/cloud/generate-text-to-speech-audio-stream | Api Controller Generate Text To Speech Audio Stream |
| nexusGenerateTextToSpeechAudio | POST /v1/nexus/generate-text-to-speech-audio | generate Text To Speech Audio |
| nexusGenerateTextToSpeechAudioStream | GET /v1/nexus/generate-text-to-speech-audio-stream | generate Text To Speech Audio Stream |
cloudApiControllerGenerateTextToSpeechAudio
kotlin.collections.List<kotlin.ByteArray> cloudApiControllerGenerateTextToSpeechAudio(body)
Api Controller Generate Text To Speech Audio
convert text to speech
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = TTSAPIApi()
val body : kotlin.Any = Object // kotlin.Any | The text to convert to speech
try {
val result : kotlin.collections.List<kotlin.ByteArray> = apiInstance.cloudApiControllerGenerateTextToSpeechAudio(body)
println(result)
} catch (e: ClientException) {
println("4xx response calling TTSAPIApi#cloudApiControllerGenerateTextToSpeechAudio")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling TTSAPIApi#cloudApiControllerGenerateTextToSpeechAudio")
e.printStackTrace()
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| body | kotlin.Any | The text to convert to speech |
Return type
kotlin.collections.List<kotlin.ByteArray>
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: application/json
- Accept: application/json
cloudApiControllerGenerateTextToSpeechAudioStream
kotlin.Any cloudApiControllerGenerateTextToSpeechAudioStream(storeId, messageId)
Api Controller Generate Text To Speech Audio Stream
convert text to speech with streaming
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = TTSAPIApi()
val storeId : kotlin.String = storeId_example // kotlin.String | The store ID
val messageId : kotlin.String = messageId_example // kotlin.String | The message ID
try {
val result : kotlin.Any = apiInstance.cloudApiControllerGenerateTextToSpeechAudioStream(storeId, messageId)
println(result)
} catch (e: ClientException) {
println("4xx response calling TTSAPIApi#cloudApiControllerGenerateTextToSpeechAudioStream")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling TTSAPIApi#cloudApiControllerGenerateTextToSpeechAudioStream")
e.printStackTrace()
}
Parameters
| storeId | kotlin.String| The store ID | |
| Name | Type | Description | Notes |
|---|---|---|---|
| messageId | kotlin.String | The message ID |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
nexusGenerateTextToSpeechAudio
java.io.File nexusGenerateTextToSpeechAudio(body)
generate Text To Speech Audio
Convert text to speech
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = TTSAPIApi()
val body : kotlin.Any = Object // kotlin.Any | The text to convert to speech
try {
val result : java.io.File = apiInstance.nexusGenerateTextToSpeechAudio(body)
println(result)
} catch (e: ClientException) {
println("4xx response calling TTSAPIApi#nexusGenerateTextToSpeechAudio")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling TTSAPIApi#nexusGenerateTextToSpeechAudio")
e.printStackTrace()
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| body | kotlin.Any | The text to convert to speech |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: application/json
- Accept: application/octet-stream
nexusGenerateTextToSpeechAudioStream
kotlin.String nexusGenerateTextToSpeechAudioStream(storeId, messageId)
generate Text To Speech Audio Stream
Convert text to speech with streaming
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = TTSAPIApi()
val storeId : kotlin.String = storeId_example // kotlin.String | The store ID
val messageId : kotlin.String = messageId_example // kotlin.String | The message ID
try {
val result : kotlin.String = apiInstance.nexusGenerateTextToSpeechAudioStream(storeId, messageId)
println(result)
} catch (e: ClientException) {
println("4xx response calling TTSAPIApi#nexusGenerateTextToSpeechAudioStream")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling TTSAPIApi#nexusGenerateTextToSpeechAudioStream")
e.printStackTrace()
}
Parameters
| storeId | kotlin.String| The store ID | |
| Name | Type | Description | Notes |
|---|---|---|---|
| messageId | kotlin.String | The message ID |
Return type
kotlin.String
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined