Skip to content

[types] Recognize audio/vnd.wave MIME type - #27

Open
n-IA-hane wants to merge 2 commits into
esphome-libs:mainfrom
n-IA-hane:fix-wav-vnd-mime
Open

n-IA-hane wants to merge 2 commits into
esphome-libs:mainfrom
n-IA-hane:fix-wav-vnd-mime

Conversation

@n-IA-hane

Copy link
Copy Markdown

WAV responses served as Content-Type: audio/vnd.wave are not recognized when the URL has no .wav extension. Detection returns NONE, and HTTP playback fails before the WAV decoder can read the data.

Add the RFC 2361 MIME alias to the existing case-insensitive WAV check, under MICRO_DECODER_CODEC_WAV.

Reported in n-IA-hane/esphome-intercom#109.

The tests cover the bare MIME type, mixed case, codec=1 parameters, and extensionless URLs with query strings. The existing HTTP playback test now exercises both audio/wav and audio/vnd.wave; codec=1, requiring bit-exact PCM output and a return to IDLE.

Validation:

  • Both affected tests fail before the fix and pass afterward.
  • All 19 CTest cases pass with AddressSanitizer, UndefinedBehaviorSanitizer and ENABLE_WERROR=ON.
  • A separate build of src/types.cpp without codec defines confirms that the alias returns NONE when WAV is disabled.
  • Pre-commit checks, cppcheck, and clang-tidy on src/types.cpp pass.

This branch has not been deployed

No deployments
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.

1 participant