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

Logarithmic binning of multiband track volumes #940

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

lukasIO
Copy link
Contributor

@lukasIO lukasIO commented Aug 5, 2024

for audio visualisation tasks it's more appropriate to use logarithmic binning of the linear frequency values in order to have a visual representation of frequency bands that more closely reflects human hearing.

Copy link

changeset-bot bot commented Aug 5, 2024

🦋 Changeset detected

Latest commit: 3445ed9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@livekit/components-react Patch
@livekit/component-example-next Patch
@livekit/components-js-docs Patch
@livekit/component-docs-storybook Patch
@livekit/components-docs-gen Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Aug 5, 2024

size-limit report 📦

Path Size
LiveKitRoom only 1.87 KB (0%)
LiveKitRoom with VideoConference 28.51 KB (0%)
All exports 34.29 KB (+0.42% 🔺)

@@ -154,3 +153,51 @@ export function useMultibandTrackVolume(

return frequencyBands;
}

function calculateLogBinEdges(minFreq: number, maxFreq: number, numBins: number): number[] {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably worth looking at Bark Scale also (https://en.wikipedia.org/wiki/Bark_scale) as it maps psychoacoustics.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, nice! might be even better!

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mel Scale - https://en.wikipedia.org/wiki/Mel_scale may be better.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One is pitch and the other is loudness scale.

@Ocupe
Copy link
Contributor

Ocupe commented Aug 6, 2024

@lukasIO I guess this is just for nicer looking visuals, right? Do you maybe have a video showing the differences to the current implementation?

@Ocupe Ocupe removed their request for review September 24, 2024 12:31
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.

3 participants