Talk Analytics API, gRPC: TalkService.UploadAsStream
rpc for streaming talk documents. First message should contain Talk related metadata,
second - audio metadata, others should contain audio bytes in chunks
gRPC request
rpc UploadAsStream (stream StreamTalkRequest) returns (UploadTalkResponse)
StreamTalkRequest
{
// Includes only one of the fields `metadata`, `audio`
"metadata": {
"connection_id": "string",
"fields": "map<string, string>",
"users": [
{
"id": "string",
"role": "UserRole",
"fields": "map<string, string>"
}
]
},
"audio": {
// Includes only one of the fields `audio_metadata`, `chunk`
"audio_metadata": {
// Includes only one of the fields `raw_audio`, `container_audio`
"raw_audio": {
"audio_encoding": "AudioEncoding",
"sample_rate_hertz": "int64",
"audio_channel_count": "int64"
},
"container_audio": {
"container_audio_type": "ContainerAudioType"
}
// end of the list of possible fields
},
"chunk": {
"data": "bytes"
}
// end of the list of possible fields
}
// end of the list of possible fields
}
streaming request to create audio dialog
Field |
Description |
metadata |
talk document metadata containing channel id and channel field values Includes only one of the fields |
audio |
audio metadata or chunk Includes only one of the fields |
TalkMetadata
Field |
Description |
connection_id |
string id of connection this talk belongs too |
fields |
object (map<string, string>) channel defined fields |
users[] |
per user specific metadata |
UserMetadata
Field |
Description |
id |
string |
role |
enum UserRole
|
fields |
object (map<string, string>) |
AudioStreamingRequest
Streaming audio request
First message should be audio metadata.
The next messages are audio data chunks.
Field |
Description |
audio_metadata |
Session options. Should be the first message from user. Includes only one of the fields |
chunk |
Chunk with audio data. Includes only one of the fields |
AudioMetadata
Audio format options.
Field |
Description |
raw_audio |
Audio without container. Includes only one of the fields |
container_audio |
Audio is wrapped in container. Includes only one of the fields |
RawAudio
RAW Audio format spec (no container to infer type). Used in AudioFormat options.
Field |
Description |
audio_encoding |
enum AudioEncoding Type of audio encoding
|
sample_rate_hertz |
int64 PCM sample rate |
audio_channel_count |
int64 PCM channel count. |
ContainerAudio
Audio with fixed type in container. Used in AudioFormat options.
Field |
Description |
container_audio_type |
enum ContainerAudioType Type of audio container.
|
AudioChunk
Data chunk with audio.
Field |
Description |
data |
bytes Bytes with audio data. |
UploadTalkResponse
{
"talk_id": "string"
}
Field |
Description |
talk_id |
string id of created talk document |