Feature/effects#61
Open
IfkumRfnl wants to merge 2 commits into
Open
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.
Description
This PR adds an audio effects pipeline and an initial echo effect exposed through the cli.
Main changes:
audio.Infofor stream metadata and normalized sample validation.fx.Effect,fx.Chain,fx.Contentinterfaces, andfx.Echo.cli_effects.Effectsto translate parsed CLI flags intofx.Chain.Generator.generateSamples()to produce normalizedf32PCM samples.wav.encodePcmF32()to encode normalized PCM into the selected WAV format.--echo--echo-delay <MS>--echo-feedback <MIX>--echo-mix <MIX>READMEand man page documentation for the new echo options.Internally this changes generation pipeline to operate on normalized
f32PCM samples before encoding into wav. This is done so that effect layer can be independent of the final output format, so effects can work the same way whether the user choosesU8,S16_LE,S24_LE, orS32_LE.Motivation and Context
Partially addresses #13. This introduces a reusable path for applying audio effects after music generation and before WAV encoding.
Echo is included as first example effect using this pipeline. More effects can be added with the same approach: implement an
fx.Effect, add CLI construction if needed, then run it throughfx.Chainbefore encoding.I would like to hear maintainer feedback on whether this API direction is acceptable and the interfaces are good enough for future effects.
How Has This Been Tested?
Tested with:
zig build testAll tests passed.
Screenshots / Logs (if applicable)
Types of Changes
Checklist: