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
type Option ¶
type Option func(*AudioParser)
Option configures an AudioParser.
func WithCacheBlockSize ¶
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 ¶
WithConcurrency sets how many audio files are probed in parallel while extracting rich metadata, and also bounds the parallel reads used within a single file (e.g. fetching the scattered chapter-title samples of an MP4 chapter track). The default is 8. A value <= 0 is ignored and keeps the default. Use 1 to probe and read fully sequentially. Note that both levels can be in flight at once, so the worst-case number of concurrent requests is roughly the square of this value.
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.