Documentation
¶
Overview ¶
This package provides the speak client implementation for the Deepgram API
Index ¶
Constants ¶
const (
PackageVersion string = "v1.0"
)
Variables ¶
var ( // ErrInvalidInput required input was not found ErrInvalidInput = errors.New("required input was not found") )
errors
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client = RESTClient
Client is an alias for RESTClient
func New ¶
func New(apiKey string, options *interfaces.ClientOptions) *Client
New creates a new speak client with the specified options
Input parameters: - ctx: context.Context object - apiKey: string containing the Deepgram API key - options: ClientOptions which allows overriding things like hostname, version of the API, etc.
func NewWithDefaults ¶
func NewWithDefaults() *Client
NewWithDefaults creates a new speak client with all default options
Notes:
- The Deepgram API KEY is read from the environment variable DEEPGRAM_API_KEY
func (*Client) DoText ¶
func (c *Client) DoText(ctx context.Context, text string, options *interfaces.SpeakOptions, keys []string, resBody interface{}) (map[string]string, error)
DoText posts the text to be spoken to a given REST endpoint
Input parameters: - ctx: context.Context object - text: contains the text for Text-to-Speech - req: SpeakOptions which allows configuring things like the speech model, etc.
Output parameters: - resBody: interface{} which will be populated with the response from the server
type RESTClient ¶ added in v1.6.0
type RESTClient struct {
*common.RESTClient
}
Client implements helper functionality for Prerecorded API