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

fix: fix stereo sound visualizations #1970

Merged
merged 4 commits into from
Nov 29, 2024

Conversation

paxcut
Copy link
Contributor

@paxcut paxcut commented Nov 26, 2024

Even tough the sound visualizer has channels as one of its parameters it wasn't using it properly.

Problem description

The biggest problem is that at each frame the index was being advanced per channel frame_count increments. The number of channels also determines how many graph will be needed to display the graphs of the visualized sound files. Besides these two problems there were many others like incorrect playback time, cracking audio, etc. which will not be mentioned.

Implementation description

To sample the signal a channel sampler was created based on the one used previously that returns as many sampled signals as there are channels. This PR aims hopefully at fixing all the problems encountered, and it has been tested extensively using Audacity exported samples to ensure the visualizer fidelity on playback and graph appearance.

Screenshots

image

paxcut and others added 4 commits November 26, 2024 04:00
Even tough the sound visualizer has `channels` as one of its parameters it wasn't using it properly. The biggest problem is that at each frame the index was being advanced per channel frame_count increments.
The number of channels also determines how many graph will be needed to display the graphs of the visualized sound files. Besides these two problems there were many others like incorrect playback time, cracking audio, etc.  which will not be mentioned.
To sample the signal a channel sampler was created based on the one used previously that returns as many sampled signals as there are channels.
This PR aims hopefully at fixing all the problems encountered, and it has been tested extensively using `Audacity` exported samples to ensure the visualizer fidelity on playback and graph appearance.
The sliding bar and the play controls were being drawn over each other.
Added milliseconds to the timer. The end of the sliding bar was off by one.
Changes to make code more efficient and better formatted.

To fix the problem I included the last two rows to the subplot block so that ImPlot can draw them each on its own line.
@WerWolv WerWolv merged commit 72822d0 into WerWolv:master Nov 29, 2024
18 checks passed
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

Successfully merging this pull request may close these issues.

2 participants