transcription

package
v0.0.0-...-6397e43 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2016 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package transcription implements functions for the manipulation and transcription of audio files.

TODO(sandlerben): This package should be refactored into several more files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertAudioIntoFormat

func ConvertAudioIntoFormat(filePath, fileExt string) (string, error)

ConvertAudioIntoFormat converts encoded audio into the required format.

func DownloadFileFromURL

func DownloadFileFromURL(url string) (string, error)

DownloadFileFromURL locally downloads an audio file stored at url.

func MakeIBMTaskFunction

func MakeIBMTaskFunction(audioURL string, emailAddresses []string, searchWords []string) (task func(string) error, onFailure func(string, string))

MakeIBMTaskFunction returns a task function for transcription using IBM transcription functions. TODO(#52): Quite a lot of the transcription process could be done concurrently.

func SendEmail

func SendEmail(username string, password string, host string, port int, to []string, subject string, body string) error

SendEmail connects to an email server at host:port and sends an email from address from, to address to, with subject line subject with message body.

func SplitWavFile

func SplitWavFile(wavFilePath string) ([]string, error)

SplitWavFile ensures that the input audio files to IBM are less than 100mb, with 5 seconds of redundancy between files.

func UploadFileToBackblaze

func UploadFileToBackblaze(filePath string, accountID string, applicationKey string, bucketName string) (string, error)

UploadFileToBackblaze uploads the given gile to the given backblaze bucket

func WriteToMongo

func WriteToMongo(data *Transcription, url string) error

WriteToMongo takes a string and writes it to the database

Types

type IBMResult

type IBMResult struct {
	ResultIndex int              `json:"result_index"`
	Results     []ibmResultField `json:"results"`
}

IBMResult is the result of an IBM transcription. See https://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/doc/speech-to-text/output.shtml for details.

func TranscribeWithIBM

func TranscribeWithIBM(filePath string, searchWords []string, IBMUsername string, IBMPassword string) (*IBMResult, error)

TranscribeWithIBM transcribes a given audio file using the IBM Watson Speech To Text API

type Transcription

type Transcription struct {
	Transcript  string
	AudioURL    string
	CompletedAt time.Time
	Timestamps  []timestamp
	Confidences []confidence
	Keywords    []ibmKeywordResult
}

Transcription contains the full transcription and other information.

func GetTranscription

func GetTranscription(results []*IBMResult) *Transcription

GetTranscription gets the full transcript from an IBMResult.

Jump to

Keyboard shortcuts

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