gensrt

package module
v0.0.0-...-6f59a55 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2020 License: Unlicense Imports: 8 Imported by: 0

README

gensrt

Generating SRT files for audio files using Google Speech-To-Text

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config ...

func NewConfig

func NewConfig(audioPath, credentialsFilePath string) (cfg *Config, err error)

NewConfig returns config reference for further API usage.

func (*Config) ProcessRequest

func (cfg *Config) ProcessRequest() (err error)

ProcessRequest generates srt file of audio clip

func (*Config) SetEncoding

func (cfg *Config) SetEncoding(encoding EncType)

SetEncoding ...

func (*Config) SetLanguage

func (cfg *Config) SetLanguage(languageCode LangCodeType)

SetLanguage ...

func (*Config) SetSampleRate

func (cfg *Config) SetSampleRate(sampleRateHz int32)

SetSampleRate ...

type EncType

type EncType int32

EncType ...

const (
	// Not specified.
	UNSPECIFIED EncType = 0
	// Uncompressed 16-bit signed little-endian samples (Linear PCM).
	LINEAR16 EncType = 1
	// `FLAC` (Free Lossless Audio Codec)
	FLAC EncType = 2
	// 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
	MULAW EncType = 3
	// Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000.
	AMR EncType = 4
	// Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000.
	AMR_WB EncType = 5
	// Opus encoded audio frames in Ogg container
	// `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000.
	OGG_OPUS EncType = 6
	// Although the use of lossy encodings is not recommended, if a very low
	// bitrate encoding is required, `sample_rate_hertz` must be 16000.
	SPEEX_WITH_HEADER_BYTE EncType = 7
)

EncType values ...

type LangCodeType

type LangCodeType string

LangCodeType ...

const (
	EnUS LangCodeType = "en-US"
)

LangCodeType values ...

Jump to

Keyboard shortcuts

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