package
Version:
v0.2.37
Opens a new window with list of versions in this module.
Published: Mar 1, 2026
License: MIT
Opens a new window with license information.
Imports: 11
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
CacheDir returns the voice cache directory path.
Generate calls the OpenAI TTS API and returns raw WAV bytes.
TextHash returns a truncated SHA-256 hash of the text (16 hex chars).
Cache manages pre-generated voice WAV files.
OpenCache loads or creates the voice cache index.
Add writes a WAV file to the cache and updates the index.
Clear deletes all cached WAV files and the index.
Lookup checks if text has a cached WAV file. Returns the file path
and true if found, or empty string and false if not cached.
Remove deletes a single cached WAV by hash and updates the index.
Save writes the cache index to disk.
type CacheEntry struct {
Text string `json:"text"`
Voice string `json:"voice"`
Hash string `json:"hash"`
Size int64 `json:"size"`
CreatedAt time.Time `json:"created_at"`
}
CacheEntry describes a single cached voice file.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.