beepspeak

package module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2020 License: MIT Imports: 13 Imported by: 2

README

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
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitSay

func InitSay(gcpAuthCrypt, passPhrase string) error

InitSay saves our GCP Speech API credentials to disk so that the GCP speech API can find them.

func Play

func Play(file string) error

Play plays a given sound file. MP3 and WAV are supported.

func Say

func Say(text string) error

Say converts text to speech and then plays it.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL