Support rf64 file type with correct file extension handling #23
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.
Adds support for rf64 as a distinct file type option while ensuring RF64 files use the correct
.wavfile extension.Problem
When running
svar -t webm(or any invalid file type), the error message incorrectly showed "wav" twice:Additionally, users could not specify
rf64as a file type since bothWRITER_TYPE_WAVandWRITER_TYPE_RF64mapped to the same "wav" string.Root Cause
Both
WRITER_TYPE_WAVandWRITER_TYPE_RF64enum values mapped to the same string "wav" via thewriter_type_to_string()function. This caused two issues:Changes Made
writer_type_to_string()insrc/writer.cto return unique identifiers:WRITER_TYPE_WAVreturns"wav"WRITER_TYPE_RF64returns"rf64"writer_type_to_extension()function to handle file extensions separately:WRITER_TYPE_WAVandWRITER_TYPE_RF64return"wav"as the file extensionsrc/recorder.cto usewriter_type_to_extension()for file namingsrc/writer.hResult
The error message now correctly displays both options:
Users can now specify either
-t wavor-t rf64, and RF64 files will be created with the correct.wavfile extension.Testing
.wavextension (not.rf64).gitignoreto exclude build artifactsOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.