audio

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2025 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

type Cmd interface {
	CombinedOutput() ([]byte, error)
}

type CreatePlaylistFunc added in v0.4.0

type CreatePlaylistFunc = func(string) (io.WriteCloser, error)

func ToCreatePlaylistFunc added in v0.4.0

func ToCreatePlaylistFunc[wc io.WriteCloser](fn func(string) (wc, error)) CreatePlaylistFunc

type ExecCmdCtx

type ExecCmdCtx = func(ctx context.Context, name string, args ...string) Cmd

func ToExecCmdCtx

func ToExecCmdCtx[c Cmd](fn func(context.Context, string, ...string) c) ExecCmdCtx

ToExecCmdCtx is needed because Go does not automatically convert return types to interfaces in function assignments, even if the return type does implement the interface. See https://stackoverflow.com/questions/57735694/duck-typing-go-functions

type File added in v0.4.0

type File struct {
	Name     string
	Segments []Segment
}

type FileCreator

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

func NewFileCreator

func NewFileCreator(
	execCmdCtx ExecCmdCtx,
	tts *TTS,
	audioFormat Format,
	tempDir string,
	outputDir string,
	createPaylistFunc CreatePlaylistFunc,
) (*FileCreator, error)

func (*FileCreator) BatchCreate added in v0.4.0

func (f *FileCreator) BatchCreate(ctx context.Context, files []File) error

func (*FileCreator) RemoveOtherFiles

func (f *FileCreator) RemoveOtherFiles() error

type Format

type Format int
const (
	M4a Format = iota
	Mp3
	Wav
	Unknown
)

func (Format) String

func (i Format) String() string

func (*Format) UnmarshalYAML

func (a *Format) UnmarshalYAML(node *yaml.Node) error

type Group

type Group struct {
	Segments []Segment
	Length   time.Duration
}

type Segment

type Segment interface {
	// contains filtered or unexported methods
}

type Silence

type Silence struct {
	Length time.Duration
}

type Sound

type Sound struct {
	Filename string
	Length   time.Duration
}

type TTS

type TTS struct {
	TTSCmd TTSCmd
	Voice  string
}

type TTSCmd

type TTSCmd int
const (
	Say TTSCmd = iota
	EspeakNG
	Custom
)

func (TTSCmd) String

func (i TTSCmd) String() string

type Text

type Text struct {
	Value  string
	Length time.Duration
}

type TextTmpl

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

func NewTextTmpl

func NewTextTmpl(str string) (*TextTmpl, error)

NewTextTmpl returns a new template. Pass a Go template string.

func (*TextTmpl) Replace

func (t *TextTmpl) Replace(values TextTmplValues) string

func (*TextTmpl) String

func (t *TextTmpl) String() string

func (*TextTmpl) UnmarshalYAML

func (t *TextTmpl) UnmarshalYAML(node *yaml.Node) error

type TextTmplValues

type TextTmplValues struct {
	WorkoutExercisesCount        int
	WorkoutDuration              string
	WorkoutDurationWithoutPauses string
	ExerciseDuration             string
	ExerciseName                 string
}

Jump to

Keyboard shortcuts

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