Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Support for Finite Audio Header Creation and Public Export of Traits #79

Open
jBernavaPrah opened this issue Jul 28, 2024 · 0 comments

Comments

@jBernavaPrah
Copy link

Hi there,

Firstly, I'd like to express my gratitude for the hound crate—it's been incredibly useful for my projects!

For my current project, I need to create a finite-length audio header. I've been using the following code to create an audio header:

let spec = hound::WavSpec {
    channels: 1,
    sample_rate: 16_000,
    bits_per_sample: 16,
    sample_format: hound::SampleFormat::Int,
};

let mut audio_headers: Vec<u8> = spec.into_header_for_infinite_file();

However, this generates an infinite header. I have not found a function within the crate that creates a finite header without needing to write the entire audio data to a writer.

Did I overlook any existing functionality for this purpose?

Given my understanding of the WAV format, I can manually adjust the length in the header. Nevertheless, having built-in support for finite headers would be very beneficial.

Additionally, it would be great if the WriteExt and ReadExt traits could be exported publicly. This would allow me to utilize functions like write_le_u32 and others directly in my code, offering more flexibility and control over the header creation process.

Thank you for considering these suggestions!

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

No branches or pull requests

1 participant