Repository navigation
AudioStreamConverter - #1551
Merged
Merged
AudioStreamConverter#1551
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds 3 new audio processing modules:
AudioStreamConverter: Takes a raw audio stream and converts to/from thefloatformat. (this is a newer version ofAudioStreamConversionwith more SIMD)AudioChannelInterleave: Takes a stream of audio frames (interleaved channels) and splits them into separate single-channel streams. Also does the reverse direction.AudioChannelMixer: Takes an N-channel audio stream and converts it to an M-channel stream using a custom weight matrix.Thus our future audio pipeline will be:
floatwe convert it tofloatusingAudioStreamConverter.AudioChannelInterleave.For the audio playback path:
4. If the sample rate does not match the audio sink's sample rate, resample it using
AudioResampler.5. Re-interleave the channels using
AudioChannelInterleave.6. Convert to the audio sink's desired format using
AudioStreamConverter.For the FFT/inference path:
4. If the sample rate is not 48 kHz, we resample it to 48 kHz using
AudioResampler.5. We collapse the streams into 1 channel using
AudioChannelMixer.6. Perform FFTs and inference.
Step 4 on both branches may be optimized to one step if the conversion is identical.