transcribe2srt

package module
v0.0.0-...-0bbecaf Latest Latest
Warning

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

Go to latest
Published: May 22, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

README

go-transcri

Import functions and structures for aws related personal code

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//ErrJobnameNotProvided represents when the content of the request is empty
	ErrJobnameNotProvided = errors.New("No job number has been provided HTTP body")
	//ErrTranscribeRunning indicates that a Transcription job is still not completed
	ErrTranscribeRunning = errors.New("The transcription job is running")
	//ErrTranscribeFailure signifies an unsuccessful Tanscription job
	ErrTranscribeFailure = errors.New("The transcription job has failed")
	//ErrJobDoesntExist advises there is no Transcription job number as provided in the request
	ErrJobDoesntExist = errors.New("The transcripting job does not exist")
)

Functions

func Convert

func Convert(jobname string) (string, error)

Convert receives a Transcribe job identifier, retrieves the job data and then converts the transcription content into an srt format, which is returned to the caller

func DownloadFile

func DownloadFile(filepath string, url string) (bool, error)

DownloadFile performs the actions of downloading a file

func Getsrttime

func Getsrttime(numerator float64) (timestring string)

Getsrttime - Generates an SRT format time string

Types

type Alternative

type Alternative struct {
	Confidence string `json:"confidence"`
	Content    string `json:"content"`
}

Alternative - Actual translated word and confidence of accuracy

type Awstranscript

type Awstranscript struct {
	JobName   string `json:"jobName"`
	Accountid string `json:"accountId"`
	Results   Result `json:"results"`
	Status    string `json:"status"`
}

Awstranscript - Top level struc for an AWS transcript job output

type Item

type Item struct {
	Starttime      string        `json:"start_time"`
	Endtime        string        `json:"end_time"`
	Alternatives   []Alternative `json:"alternatives"`
	Classification string        `json:"type"`
}

Item - Individual translation word/punctuation record

type Result

type Result struct {
	Transcripts []Transcript `json:"transcripts"`
	Items       []Item       `json:"items"`
}

Result - Result structure

type Transcript

type Transcript struct {
	Transcript string `json:"transcript"`
}

Transcript - Transcription

Jump to

Keyboard shortcuts

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