Documentation ¶
Overview ¶
This package provides the speak client implementation for the Deepgram API
Index ¶
Constants ¶
const ( LogLevelDefault = common.LogLevelDefault LogLevelErrorOnly = common.LogLevelErrorOnly LogLevelStandard = common.LogLevelStandard LogLevelElevated = common.LogLevelElevated LogLevelFull = common.LogLevelFull LogLevelDebug = common.LogLevelDebug LogLevelTrace = common.LogLevelTrace LogLevelVerbose = common.LogLevelVerbose )
please see pkg/common/init.go for more information
Variables ¶
var ( // ErrInvalidInput required input was not found ErrInvalidInput = errors.New("required input was not found") )
errors
Functions ¶
func Init ¶
func Init(init InitLib)
The SDK Init function for this library. Allows you to set the logging level and use of a log file. Default is output to the stdout.
func InitWithDefault ¶
func InitWithDefault()
InitWithDefault is the SDK Init function for this library using default values.
Types ¶
type Client ¶
Client implements helper functionality for Prerecorded API
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, retValues *map[string]string, resBody interface{}) 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