Documentation ¶
Overview ¶
Package cybervox implements all structs and functions necessary to talk to the CyberVox api platform.
Index ¶
- func Dial() (*websocket.Conn, *http.Response, error)
- type PingRequest
- type PingRequestPayload
- type PingResponse
- type PingResponsePayload
- type STTRequest
- type STTRequestPayload
- type STTResponse
- type STTResponsePayload
- type TTSRequest
- type TTSRequestPayload
- type TTSResponse
- type TTSResponsePayload
- type UploadRequest
- type UploadRequestPayload
- type UploadResponse
- type UploadResponsePayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PingRequest ¶
type PingRequest struct { Emit string `json:"emit"` Payload PingRequestPayload `json:"payload"` }
PingRequest contains the parameters to send a `ping` message to the platform.
type PingRequestPayload ¶
type PingRequestPayload struct {
Timestamp int64 `json:"timestamp"`
}
type PingResponse ¶
type PingResponse struct { Event string `json:"event"` Payload PingResponsePayload `json:"payload"` }
PingResponse contains the parameters sent in response to a `ping` message.
func Ping ¶
func Ping(ws *websocket.Conn) (response PingResponse)
Ping sends a ping request on an established websocket connection. It receives the websocket.Conn and assumes it's properly connected and returns a PingResponse with the given Timestamp.
type PingResponsePayload ¶
type STTRequest ¶
type STTRequest struct { Emit string `json:"emit"` Payload STTRequestPayload `json:"payload"` }
STTRequest contains the parameters to send a `stt` message to the platform.
type STTRequestPayload ¶
type STTRequestPayload struct { Timestamp int64 `json:"timestamp"` UploadID string `json:"upload_id"` }
STTRequestPayload most important field is the `UploadID` to be transcribed into a text block.
type STTResponse ¶
type STTResponse struct { Event string `json:"event"` Payload STTResponsePayload `json:"payload"` }
STTResponse contains the parameters sent in response to a `stt` message.
type STTResponsePayload ¶
type STTResponsePayload struct { Success bool `json:"success"` // successfully transcribed STTRequestPayload.UploadID into a block of text Reason string `json:"reason"` // if Success is false, the failure reason Text string `json:"text"` // if Success is true, the block of transcribed text Timestamp int64 `json:"timestamp"` // the given STTRequestPayload.Timestamp }
type TTSRequest ¶
type TTSRequest struct { Emit string `json:"emit"` Payload TTSRequestPayload `json:"payload"` }
TTSRequest contains the parameters to send a `tts` message to the platform.
type TTSRequestPayload ¶
type TTSRequestPayload struct { Timestamp int64 `json:"timestamp"` Text string `json:"text"` Voice string `json:"voice"` }
TTSRequestPayload most important field is the `Text` to be converted into a WAVE file.
type TTSResponse ¶
type TTSResponse struct { Event string `json:"event"` Payload TTSResponsePayload `json:"payload"` }
TTSResponse contains the parameters sent in response to a `tts` message.
type TTSResponsePayload ¶
type TTSResponsePayload struct { Success bool `json:"success"` // successfully converted TTSRequestPayload.Text into a WAVE file Reason string `json:"reason,omitempty"` // if Success is false, the failure reason AudioURL string `json:"audio_url,omitempty"` // if Success is true, the WAVE file url to be downloaded Timestamp int64 `json:"timestamp,omitempty"` // the given TTSRequestPayload.Timestamp }
type UploadRequest ¶
type UploadRequest struct { Emit string `json:"emit"` Payload UploadRequestPayload `json:"payload"` }
UploadRequest contains the parameters to send a `upload` message to the platform.
type UploadRequestPayload ¶
type UploadResponse ¶
type UploadResponse struct { Event string `json:"event"` Payload UploadResponsePayload `json:"payload"` }
UploadResponse contains the parameters sent in response to an `upload` message.