Skip to content

lmnt-com/lmnt-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LMNT Go SDK

The LMNT Go SDK provides convenient access to the LMNT API from Go applications.

Documentation

Full documentation is available at docs.lmnt.com/api/sdks/go.

Installation

go get github.com/lmnt-com/lmnt-go/v2

Getting started

package main

import (
	"context"
	"io"
	"os"

	lmnt "github.com/lmnt-com/lmnt-go/v2"
	"github.com/lmnt-com/lmnt-go/v2/option"
)

func main() {
	client := lmnt.NewClient(
		option.WithAPIKey(os.Getenv("LMNT_API_KEY")), // This is the default and can be omitted
	)

	response, err := client.Speech.Generate(context.TODO(), lmnt.SpeechGenerateParams{
		Text:  "hello world.",
		Voice: "leah",
	})
	if err != nil {
		panic(err)
	}
	defer response.Body.Close()

	out, _ := os.Create("speech.mp3")
	defer out.Close()
	io.Copy(out, response.Body)
}

Requirements

Go 1.23 or later is supported.

About

The LMNT Go SDK provides convenient access to the LMNT API from Go applications.

Resources

License

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors