Categorygithub.com/erikbryant/beepspeak
modulepackage
0.7.0
Repository: https://github.com/erikbryant/beepspeak.git
Documentation: pkg.go.dev

# README

go fmt go vet go test

Beep Speak

Takes audio files as input and plays them. Also takes text as input, converts it to speech, and plays it.

If you use the text-to-speech functions then you need to provide a GCP Speech API Token.

Usage (playing sound files)

import (
  "github.com/erikbryant/beepspeak"
)

err := beepspeak.Play("mysong.wav")
if err != nil {
  return err
}

beepspeak.Play("mymusic.mp3")
if err != nil {
  return err
}

Usage (text to speech)

import (
  "github.com/erikbryant/aes"
  "github.com/erikbryant/beepspeak"
)

// Put your GCP Speech API credentials in plainText.
plainText := "<redacted>"
passphrase := "MySuperSecurePassword"

cipherText, err := aes.Encrypt(plainText, passphrase)
if err != nil {
  return err
}

err = beepspeak.InitSay(cipherText, passphrase)
if err != nil {
  return err
}

err = beepspeak.Say("Hello, world!")
if err != nil {
  return err
}

# Packages

No description provided by the author

# Functions

InitSay saves our GCP Speech API credentials to disk so that the GCP speech API can find them.
Play plays a given sound file.
Say converts text to speech and then plays it.