Skip to content

Commit

Permalink
Fix: (Record) restore previous continuous mode duration calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh committed Sep 11, 2024
1 parent 4647779 commit 089a5e4
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/plugins/record.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,6 @@ class RecordPlugin extends BasePlugin<RecordPluginEvents, RecordPluginOptions> {
// Render the waveform
if (this.wavesurfer) {
const totalDuration = (this.dataWindow?.length ?? 0) / FPS
let position = sampleIdx / this.dataWindow.length
if (this.wavesurfer.options.barWidth) {
position += this.wavesurfer.options.barWidth / this.wavesurfer.getWidth()
}
this.wavesurfer
.load(
'',
Expand All @@ -183,7 +179,7 @@ class RecordPlugin extends BasePlugin<RecordPluginEvents, RecordPluginOptions> {
)
.then(() => {
if (this.wavesurfer && this.options.continuousWaveform) {
this.wavesurfer.seekTo(position)
this.wavesurfer.setTime(this.getDuration() / 1000)

if (!this.wavesurfer.options.minPxPerSec) {
this.wavesurfer.setOptions({
Expand Down

0 comments on commit 089a5e4

Please sign in to comment.