I'm working with the Hound library to implement uploading a large WAV file via multipart upload to a storage service. I've got everything working except for one key aspect: creating the WAV header.
Scenario: I'm concatenating several smaller WAV files (referred to as 'parts') into a larger file for upload. Given the final file's size can exceed 2GB, and aiming for memory efficiency, I plan to upload each part sequentially using a multipart upload API. The challenge arises with the WAV format's requirement for the 'data chunk size' in the header, as the total size isn't known upfront during the initial upload.
Hound offers an into_header_for_infinite_file method, which seems like a workaround. However, its documentation suggests it's more suited for streaming contexts, potentially leading to 'non-standard' WAV files.
Current Approach: With access to the total duration (in ms) of the intended final output, I've devised a custom create_wav_header method for the initial part's upload but remain open to more standard solutions.
Questions:
Has anyone faced a similar challenge and found a more standard solution within Hound or through another approach?
Are there implications of using the into_header_for_infinite_file method for non-streaming applications that I should be aware of?
Technical Context:
Rust version: 1.76.0
Hound version: 3.5.1
Appreciate any insights or advice on this matter. Thanks!
Hello,
I'm working with the Hound library to implement uploading a large WAV file via multipart upload to a storage service. I've got everything working except for one key aspect: creating the WAV header.
Scenario: I'm concatenating several smaller WAV files (referred to as 'parts') into a larger file for upload. Given the final file's size can exceed 2GB, and aiming for memory efficiency, I plan to upload each part sequentially using a multipart upload API. The challenge arises with the WAV format's requirement for the 'data chunk size' in the header, as the total size isn't known upfront during the initial upload.
Hound offers an
into_header_for_infinite_file
method, which seems like a workaround. However, its documentation suggests it's more suited for streaming contexts, potentially leading to 'non-standard' WAV files.Current Approach: With access to the total duration (in ms) of the intended final output, I've devised a custom
create_wav_header
method for the initial part's upload but remain open to more standard solutions.Questions:
into_header_for_infinite_file
method for non-streaming applications that I should be aware of?Technical Context:
Appreciate any insights or advice on this matter. Thanks!