-
-
Notifications
You must be signed in to change notification settings - Fork 774
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: Add AAC decoding #16526
base: master
Are you sure you want to change the base?
audio: Add AAC decoding #16526
Conversation
d7ad389
to
eb83b74
Compare
a5d0e04
to
d82f98d
Compare
05e536a
to
b3db352
Compare
I marked this as ready for review. The only thing I'm unsure about is whether the test needs more explanation. |
|
||
ffmpeg -f lavfi -i "sine=frequency=444:duration=1:sample_rate=44100" -af "volume=5" -ac 2 -c:a aac tone_stereo_44100hz.flv | ||
ffmpeg -f lavfi -i "sine=frequency=444:duration=1:sample_rate=48000" -af "volume=5" -ac 2 -c:a aac tone_stereo_48000hz.flv | ||
ffmpeg -f lavfi -i "sine=frequency=444:duration=1:sample_rate=22050" -af "volume=5" -ac 2 -c:a aac tone_stereo_22050hz.flv | ||
ffmpeg -f lavfi -i "sine=frequency=444:duration=1:sample_rate=44100" -af "volume=5" -ac 1 -c:a aac tone_mono_44100hz.flv | ||
ffmpeg -f lavfi -i "sine=frequency=444:duration=1:sample_rate=48000" -af "volume=5" -ac 1 -c:a aac tone_mono_48000hz.flv | ||
ffmpeg -f lavfi -i "sine=frequency=444:duration=1:sample_rate=22050" -af "volume=5" -ac 1 -c:a aac tone_mono_22050hz.flv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe put it in generate_test_sounds.sh
?
for (var j:uint=0; j<256; j++) { | ||
var sp = ba.readFloat(); | ||
var arg = j * coeff; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some mixed spaces and tabs in this file
if self.sample_buf.capacity() < decoded.capacity() { | ||
// Ensure our buffer has enough space for the decoded samples. | ||
self.sample_buf = audio::SampleBuffer::new( | ||
decoded.capacity() as core::units::Duration, | ||
*decoded.spec(), | ||
); | ||
} | ||
self.sample_buf.copy_interleaved_ref(decoded); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's some code duplication with mp3
, maybe we should add some utility method or SampleBuffer
wrapper?
#[cfg(feature = "aac")] | ||
mod aac { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other decoders have their own files, maybe we should also move it to aac.rs
for consistency?
WIP, mostly pushing for visibility.Will fix the audio part of #8891.
TODO:
Parse "sequence headers", and configure the decoder accordingly.M4AInfo
Split into reasonable, smaller commits.Make sure no build errors whether the newaac
feature is enabled or not...Add some kind of test with different channel counts and sample rates.