Support rf64 file type with correct file extension handling - #23
Conversation
|
@copilot When app called like this: $ svar -t webm
error: Unknown output file type {raw, mp3, wav, wav, ogg}: webm |
Fixed in a0b792d. The duplicate "wav" was caused by both WRITER_TYPE_WAV and WRITER_TYPE_RF64 mapping to the same string. The error message now correctly shows: Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot but now it's not possible to use rf64 type, the output should be: |
Fixed in fd54313. Created separate |
fd54313 to
01ccf8c
Compare
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.