-
Notifications
You must be signed in to change notification settings - Fork 44
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
Audio Compression #37
Comments
Hi Trek!
The quick answer is, it does not. At least not currently. This is tracked by #35 which covers the implementation of LPC encoding of audio samples.
That sounds about right. The audio samples are currently encoded using the verbatim (i.e. uncompressed) method, or the constant method (when all audio samples of a frame are the same). However, as noted above, LPC encoding is yet to be implemented, and it is only once this has been implemented that you will see a compression of audio streams. My brother @karlek and I are coding on the flac project when we get the feeling to, and usually that is during summer hackathons :) If you are interested in audio encoding and would be interested in contributing to the project, feel most welcome to take a stab at implementing LPC encoding :) Take a look at encode_subframe.go for the LPC encoding method yet to be implemented. // Encode audio samples.
switch subframe.Pred {
case frame.PredConstant:
if err := encodeConstantSamples(bw, hdr.BitsPerSample, subframe.Samples); err != nil {
return errutil.Err(err)
}
case frame.PredVerbatim:
if err := encodeVerbatimSamples(bw, hdr, subframe.Samples); err != nil {
return errutil.Err(err)
}
//case frame.PredFixed:
// if err := encodeFixedSamples(bw, hdr, subframe.Samples, subframe.Order); err != nil {
// return errutil.Err(err)
// }
//case frame.PredFIR:
// if err := encodeFIRSamples(bw, hdr, subframe.Samples, subframe.Order); err != nil {
// return errutil.Err(err)
// } Cheers, |
Hello, are there any plans now to move this issue forward? |
Hi @severincognito! Neither Henry nor I are looking into implementing compression of audio samples for the foreseeable time in the future. That being said, anyone in the community who feel up to the task is warmly invited to take up the challenge. As noted above in #37 (comment) the missing component is support LPC encoding (as tracked by issue #35). Do you have experience with audio codes @severincognito? Or even better, feel like learning something new? : ) Should you feel up for the challenge @karlek and I can try to guide you if you get stuck in any part of the Wish you a most lovely Spring. Warm regards, |
can i work on this ? i saw the comm #35 and u already did imp encodeFIRSamples and fixedS ..... so what the problem now is it u wanna implement wav2flac or what u wanna do exactly .... |
As i understand it #35 only adds support for encoding the LPC sample format but does not include any code for doing linear prediction. So if you want to implement a I don't know much about linear prediction but in the #35 description there is link to #32 (comment) with some pointers. |
i will work on it in this weekend then im also don't know much about linear prediction but i will learn and work on it in the same time what the worse thing could hpn lol |
That's the spirit! And, precisely like @wader pointed out. The #35 PR implemented encoding of LPC audio samples. The remaining part now is to do the linear prediction, i.e. to find good coefficients for storing the audio samples such that they take less space. Wish you happy coding @ilyassBZ and a good learning adventure : ) Cheerful regards from Chile, |
Hi,
I'm interested to know if this package compresses audio when encoding it to flac. I have tried out the wav2flac program in the cmd folder however when given a 5 second stereo wav file sampled at 48kHz, the flac file produced is larger by 240kb.
Since wav is uncompressed and flac is supposed to be encoded using lossless compression, I was expecting a smaller file size. Am I missing something?
Thanks,
-Trek
The text was updated successfully, but these errors were encountered: