audio

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: BSD-3-Clause Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AudioParser

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

Handles parsing of audiobooks from an unstructured archive format containing audio files, such as ZAB (Zipped Audio Book) or a simple ZIP. It can also work for a standalone audio file.

func NewParser

func NewParser() AudioParser

func NewRichParser

func NewRichParser(opts ...Option) AudioParser

func (AudioParser) Parse

func (p AudioParser) Parse(ctx context.Context, asset asset.PublicationAsset, fetcher fetcher.Fetcher) (*pub.Builder, error)

Parse implements PublicationParser

type Option

type Option func(*AudioParser)

Option configures an AudioParser.

func WithCacheBlockSize

func WithCacheBlockSize(size int) Option

WithCacheBlockSize sets the block size (in bytes) of the per-file read cache used while probing audio files for rich metadata. The default is 256 KiB. A value <= 0 is ignored and keeps the default. Larger blocks coalesce more reads into each range request (fewer requests, more bytes); smaller blocks transfer less when reads are scattered.

func WithConcurrency

func WithConcurrency(n int) Option

WithConcurrency sets how many audio files are probed in parallel while extracting rich metadata. The default is 8. A value <= 0 is ignored and keeps the default. Use 1 to probe sequentially.

func WithoutEmbeddedChapters

func WithoutEmbeddedChapters() Option

WithoutEmbeddedChapters disables extracting the table of contents from chapter markers embedded in the audio files (e.g. an MP4 chapter track or Vorbis CHAPTER comments). This avoids the extra reads they require; the TOC then comes from a playlist or per-file titles when available.

Jump to

Keyboard shortcuts

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