Permalink
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
mtai-protos/protos/vc/v1/service.proto
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
108 lines (82 sloc)
2.42 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| syntax = "proto3"; | |
| package vc.v1; | |
| option java_package = "com.mthreads.ai.protos.vc.v1"; | |
| // Service that implements VC API. | |
| service VoiceConversion { | |
| // Convert the input speech to a given voice | |
| rpc StreamingVC(stream StreamingVCRequest) returns (stream StreamingVCResponse); | |
| } | |
| // NextID: 4 | |
| message VoiceConversionAudioInfo { | |
| // The audio sample rate | |
| int32 sample_rate = 1; | |
| // The num of channels | |
| int32 channels = 2; | |
| // The audio format | |
| // Supported formats: | |
| // 1. "LINEAR16": header-less s16le | |
| string audio_encoding = 3; | |
| } | |
| // NextID: 4 | |
| message VoiceConversionConfig { | |
| // The target speaker | |
| string voice = 1; | |
| // The information of the source audio | |
| VoiceConversionAudioInfo input_info = 2; | |
| // The information of the output audio | |
| VoiceConversionAudioInfo output_info = 3; | |
| } | |
| enum StreamingVCDataType { | |
| // default type | |
| UNKNOWN_TYPE = 0; | |
| // normal chunk | |
| NORMAL_CHUNK = 1; | |
| // last chunk | |
| LAST_CHUNK = 2; | |
| } | |
| // NextID: 3 | |
| message StreamingVCData { | |
| // The event specify whether it is the last chunk of this request | |
| StreamingVCDataType data_type = 1; | |
| // The header-less audio data | |
| bytes audio_data = 2; | |
| } | |
| // The top-level message sent by the client for the `StreamingVC` method. | |
| message StreamingVCRequest { | |
| // NextID: 3 | |
| oneof payload { | |
| // The configuration of the conversion. Used in the first request. | |
| VoiceConversionConfig config = 1; | |
| // After the first request, data will be sended continuously. | |
| // The data contains the audio bytes and the state, last chunk or not. | |
| StreamingVCData data = 2; | |
| } | |
| } | |
| enum StreamingVCStatus { | |
| // default status | |
| UNKNOWN_STATUS = 0; | |
| // The configuration is set. | |
| CONFIG_OK = 1; | |
| // The conversion is on-going. | |
| CONVERSION_OK = 2; | |
| // The conversion is finished. | |
| CONVERSION_END = 3; | |
| // The configuration is failed. | |
| CONFIG_FAILED = 4; | |
| // The conversion is failed. | |
| CONVERSION_FAILED = 5; | |
| } | |
| // The message returned to the client by the `SynthesizeSpeech` method. | |
| // NextID: 4 | |
| message StreamingVCResponse { | |
| // The status of the conversion. | |
| StreamingVCStatus status = 1; | |
| // The audio data bytes encoded as specified in the request, | |
| // excluding the header for encodings. | |
| bytes audio_data = 2; | |
| // The response message | |
| // This is used to return the detailed information. | |
| // For example, when the configuration and conversion is successful, | |
| // it will return "Configuration/Conversion succeeded." | |
| string message = 3; | |
| } |