Skip to content

add WAV, M4A, and FLAC audio format detection#168

Merged
kryptobi merged 1 commit into
Traperto:mainfrom
wilsonwc:feature/add-audio-formats
May 13, 2026
Merged

add WAV, M4A, and FLAC audio format detection#168
kryptobi merged 1 commit into
Traperto:mainfrom
wilsonwc:feature/add-audio-formats

Conversation

@wilsonwc

Copy link
Copy Markdown

Summary

  • Add WAV format — RIFF container with WAVE identifier (52 49 46 46 xx xx xx xx 57 41 56 45)
  • Add M4A format — ftyp box with M4A/M4B brand, distinguishing MPEG-4 audio from video MP4
  • Add FLAC format — fLaC magic marker (66 4C 61 43)
  • 8 unit tests covering positive and negative matching for all three formats
  • README table updated with new entries

These are common audio formats that were missing from the library. The M4A definition specifically checks the ftyp brand (M4A / M4B ) rather than just the ftyp marker, so it won't match generic MP4 video files.

Add three missing audio file type definitions:
- WAV: RIFF container with WAVE identifier
- M4A: ftyp box with M4A/M4B brand (distinguishes audio from video MP4)
- FLAC: fLaC magic marker

Includes unit tests and README updates.

@brentrager brentrager left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@kryptobi

Copy link
Copy Markdown
Contributor

Hi wilsonwc i'll check your pr in the next few days :-)

@kryptobi kryptobi merged commit d44abf0 into Traperto:main May 13, 2026
3 checks passed
@kryptobi

Copy link
Copy Markdown
Contributor

Hi @wilsonwc and @brentrager
i merged your pr, bumped some dependencies and released a new version.
thanks for your support - i appreciate it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants