-
Notifications
You must be signed in to change notification settings - Fork 5
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
Not accurate waveform #5
Comments
Not sure exactly what you mean. Can you attach an image which shows the
issue?
Den fre 13 okt. 2017 17:44NPetrovs <[email protected]> skrev:
Hey,
From what I can see, if I upload any audio file, both sides (left/right)
of the waveform are identical.
Mirror of the waveform differ and they should not be identical.
Is it possible to fix?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#5>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AA1jjwtbnkpr_ex6Z5eLz1KyQUFN1_-oks5sr4VigaJpZM4P4rv->
.
--
Med vänlig hälsning,
Jeremy Karlsson
|
Hope, that you understand what I mean. |
Aha! Never thought about that the top and bottom are different channels in
other representations of waveforms.
Today it's the frequency data value of both channels combined (or maybe
only one of them, can't remember — not at PC rn) that gives a value, which
is then used as the height of a bar.
It should be possible to make the top side L and the bottom R, at least for
the "center align" case. Not sure how we'd represent it for "top align" and
"bottom align" through...
I'll look into adding this feature. Thanks for pointing this out!
Den fre 13 okt. 2017 18:36NPetrovs <[email protected]> skrev:
Hope, that you understand what I mean.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA1jjzGLg5AMaDsJFEaXDbKLm5-vHMdaks5sr5GAgaJpZM4P4rv->
.
--
Med vänlig hälsning,
Jeremy Karlsson
|
I've started experimenting with it in this branch; https://github.com/enjikaka/WaveformGenerator.js/tree/feature/stereo-waveform |
Check out this code: https://codepen.io/ronanhigg/pen/gmFaq
In JS function drawBuffer() pretty much does all the job and it draws the
wave correctly.
You should probably check it out and try to add something to your code.
2017-10-14 0:54 GMT+03:00 Jeremy Karlsson <[email protected]>:
… I've started experimenting with it in this branch;
https://github.com/enjikaka/WaveformGenerator.js/tree/
feature/stereo-waveform
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AMd_K0FclV_E2MMkAxuJUPIa8cNqhgaFks5sr9v_gaJpZM4P4rv->
.
|
Doing buffer.getChannelData(0) and for other one buffer.getChannelData(1)
would be wrong, because you would be connecting together two independent
track information.
2017-10-14 0:58 GMT+03:00 Normunds Petrovs <[email protected]>:
… Check out this code: https://codepen.io/ronanhigg/pen/gmFaq
In JS function drawBuffer() pretty much does all the job and it draws the
wave correctly.
You should probably check it out and try to add something to your code.
2017-10-14 0:54 GMT+03:00 Jeremy Karlsson ***@***.***>:
> I've started experimenting with it in this branch;
> https://github.com/enjikaka/WaveformGenerator.js/tree/featur
> e/stereo-waveform
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#5 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AMd_K0FclV_E2MMkAxuJUPIa8cNqhgaFks5sr9v_gaJpZM4P4rv->
> .
>
|
The result in the branch for an example stereo track, I used this https://www.youtube.com/watch?v=kh8akNfMRa0 Isn't that what you want? |
Correct waveform for this track would be this: What you are doing, you are taking the stereo channel buffer.getChannelData(1) and applying it as a mirror of the track, which is not correct. You have to draw correct image just using buffer.getChannelData(0). Like it is done in this code example: https://codepen.io/ronanhigg/pen/gmFaq |
Only using channel 0 (L) is what is done today. What I've done there in the branch is that I've that I've taken channel 0 (L) on the top, and channel 1 (R) on the bottom. Like you explained. That gives a waveform like in my last picture. It's either that or using L+R to make a combined bar height. |
Could you explain how this code is drawing different L/R if I pass only buffer.getChannelData(0) in data argument?
|
@NPetrovs If you pass
|
Yes, correct that is stereo. I probably did not explain too clear
previously. The thing is that *plus* and a *minus *channel information are
equal, but it should not be like that.
Here is post from quora, explanation about audio mirror -
https://www.quora.com/Why-are-waveforms-mirrored
Could it be fixed in your code?
2017-10-16 15:36 GMT+03:00 Jeremy Karlsson <[email protected]>:
… @NPetrovs <https://github.com/npetrovs> If you pass
buffer.getChannelData(0) into that you'd only get L channel.
buffer.getChannelData(0) = left channel
buffer.getChannelData(1) = right channel
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AMd_K1hy8ufkZ0un24vUwgi7YBZyzPLmks5ss03GgaJpZM4P4rv->
.
|
Hey,
From what I can see, if I upload any audio file, both sides (left/right) of the waveform, they are identical.
Mirror of the waveform should be different and they should not be identical.
Is it possible to fix?
The text was updated successfully, but these errors were encountered: