【question】peaks is not the best match
See original GitHub issueIn the process of learning, I find that my Audition is inconsistent with Adobe Audition。
My expression ability is not very good, but I tried to describe the problem and hope to get your reply. I attached the relevant audio in the issue
- The highest peak waveform of wavesurfer is actually not the real peak
- The real peak is not shown in the waveform, and the reason is probably because of the step size of the selection algorithm
- wavesurfer and adobe audition time stamp location do not match, difference is close to 1 second
start: 422205, end: 436073, lenght: 13868, maxAplitude: 13849.4228515625
- wavesurfer 10+s
- adobe audition 9+s
my env
Additional information:
- container div width: 1280
- ratio :2
wavsurfer params:
container: '#waveform',
scrollParent: true,
ignoreSilenceMode: false,
progressColor: '#3B8686',
backend: 'MediaElement',
height: 600,
normalize: true,
target wav file
02_01_P00027_01_wav_00964.wav.zip
problem1:
Looking at wavesurfer’s source code, I wonder if we missed the best peak because we made some choices for performance.
- buffer len: 1060737
- length = 1280*2 // width 1280, ratio 2
- so we have 1060737/2560=414 group, and step size 414/10 =41
- And we can’t customize the step size (at least not now) https://github.com/katspaugh/wavesurfer.js/blob/9e8aed5b964ac6c743333a8980aa5bfdb5b7cdc2/src/webaudio.js#L456-L458
problem2:
Why does it have the same peak effect as the Audition? The key is the time difference?
I think we’re gonna be okay because : samplereate -> 422205/41000 = 10.2976829268 second, we are correct. start:422205,end:436073,lenght:13868,maxAplitude:
13849.4228515625
problem3:
Can the problem of missing the best peak value selected by peaks be further optimized through callback function form where we can control the step size by ourselves?
![image](https://user-images.githubusercontent.com/46706370/197370944-f765a10d-884d-4c08-9ebc-88515f7ecf31.png)
full image:
WAVESURFER:
Adobe auditon:
max aplitude
wavesurfer:
- time:
- start: 10.297687712585034
- end: 10.635932929421768
start:422205,end:436073,lenght:13868,maxAplitude:
13849.4228515625
Probem1
: It’s clearly not the highest waveform region in the pictureProblem2
: Adobe audition The timestamps in the same area are different from waveSurfer
wavesufer:
audition with sample:
audition with time line:
Issue Analytics
- State:
- Created a year ago
- Comments:8 (5 by maintainers)
In the future, if I submit relevant codes, I will attach this issue.
wo set the Step size to 1 and get this waveform same as auditon complately。
wavesurfer:
audition:
Thank you very much. I will submit PR at some time. Please provide custom functions to control the selection of peak and define absMax.
This allows us to customize our own algorithm when we have fineness drawing requirements.
@thijstriemstra @katspaugh
thanks again . Cheers!