feat: add audio file support (MP3, WAV, FLAC, OGG, AAC, M4A)#20
Open
hai-pilgrim wants to merge 1 commit intomarksverdhei:mainfrom
Open
feat: add audio file support (MP3, WAV, FLAC, OGG, AAC, M4A)#20hai-pilgrim wants to merge 1 commit intomarksverdhei:mainfrom
hai-pilgrim wants to merge 1 commit intomarksverdhei:mainfrom
Conversation
Audio files were previously skipped as unreadable binaries. This adds: - `is_audio()` detection via magic bytes (ID3, RIFF/WAVE, fLaC, OggS, ADTS, M4A ftyp box) with extension fallback - Audio metadata extraction via `ffprobe`: title, artist, album, genre, year, duration, bitrate, codec, sample rate - `build_user_content()` audio mode passes rich metadata as text context so the LLM can suggest a name based on embedded tags - 13 new bats tests covering detection, metadata, and end-to-end naming - README updated with audio formats and ffprobe optional dependency Closes marksverdhei#19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #19
Audio files (
.mp3,.wav,.flac,.ogg,.aac,.m4a) were previously skipped with "binary file, skipping". This PR adds full audio support:is_audio()detection via magic bytes (ID3 header, MPEG sync,fLaC,OggS, ADTS, M4Aftypbox) with extension fallbackffprobe: title, artist, album, genre, date, duration, bitrate, codec, sample ratebeethoven-symphony-5-mvmt1.flac). No audio bytes are sent to the LLM.--dry-runnamingffprobeas optional dependencyffprobe(fromffmpeg) is optional — if unavailable the file is still processed with basic metadata and whatever context the LLM can infer.Test plan
bats test.sh— all 13 new audio tests passhat --dry-run --force some-song.mp3