Cueing Long Recordings from Waveforms with wavesurfer.js

プログラミング・Web開発カテゴリを表すパンダのイラスト Programming / Web Development

About This Article
This article was generated using an automated workflow powered by generative AI. Official documentation and fixed learning materials were reviewed to organize operational and technical constraints.

Verification Status: 📘 Official Information and Implementation Cross-Check. Browser implementation unverified.

To locate the start of speech within a long recording, volume variations serve as visual markers. Using test audio featuring pronounced audio peaks, playback positions are selected directly from the waveform.

Open Live Demo

Key Terms to Know First

  • WaveformA visual representation of audio amplitude over time.

  • CueingNavigating to the desired playback position.

Thinking in Terms of Timelines

Volume differences are indicated per segment. The live demo locates the region around the 2-second mark using the waveform.

timeline
    title 実験用の音声
    0〜2秒 : 小さい音
    2〜3秒 : 大きい音
    3〜6秒 : 小さい音

Live Demo Operations

Click just before the waveform peak. Press play.

How to Interpret Results

Audio plays back starting from the selected position.

Low-volume sections can also be played back. If the volume remains constant near the target speech, combine this with transcripts or timestamp notes.

Code Highlights

Click on the waveform to reposition without playing, and then play.

You can check the implementation in the Implementation Code section of the demo screen.

When using it for work

Listen to the audio to determine its content. Use the waveform as a visual marker for positioning.

Finding a position in a 6-second audio clip

Clicking the run button is expected to display the waveform of a short audio clip. The audio is not an actual meeting recording, but a 6-second artificial sound generated by the implementation. The volume is low from 0 to around 2 seconds, loud from 2 to around 3 seconds, and low again afterward. Assuming the entire width of the waveform represents 6 seconds, click just before the peak. Check the result field to see the timestamp and verify whether you successfully navigated to around the 2-second mark.

Press the play/stop button to verify whether sound can be heard from the selected position. Because a loud sound may suddenly play, set the volume to a low level before testing. Stop playback and select a different position. Do not assume that low parts of the waveform are completely silent, as audio data still exists there. Depending on device settings or browser playback restrictions, sound may not be audible.

What is being rendered as a waveform

Audio data can be recorded as amplitude values over time. The tutorial generates mono 16-bit PCM at 8,000 samples per second, totaling 48,000 samples for 6 seconds. This combines a 44-byte header and 96,000 bytes of data, resulting in 96,044 bytes. Because only the amplitude of the sine wave is varied across intervals, you can observe differences in volume rather than determining changes in content or frequency. The result of running the same generation process locally is as follows.

Time intervalMaximum absolute amplitude
0 to 2 seconds1200
2 to 3 seconds13000
3 to 6 seconds1200

These values are PCM integer values and do not measure sound pressure emitted from speakers or perceived volume by humans. Volume also varies depending on the device, output hardware, and playback settings. While it has been confirmed that data with increased amplitude intervals is generated, waveform rendering and audio playback in wavesurfer remain unverified.

Mechanism for selecting a position

The implementation passes the generated WAV as a Blob to loadBlob. It captures waveform interactions via the interaction event and displays the time in seconds to two decimal places. Because playPause is called from the play/stop buttons, you can test listening to the audio and selecting a position separately. The waveform is a visual cue for humans to find the target position and is not a function for recognizing the meaning of speech.

When dealing with long recordings, it can sometimes be difficult to select precise timestamps using only the horizontal width of the waveform. Combining zoom, time axes, and transcript positional information is useful. The learning material for this topic does not have an input field for loading arbitrary audio files, but instead generates short data on the fly. Memory consumption and decoding times for long recordings have not been measured.

When reviewing recordings for work

When handling recordings of meetings or inquiries, check the permissions for recording, viewing, and sharing in advance. Since waveform peaks do not necessarily correspond to important statements, listen to the preceding and following audio to verify the content. Aligning the minutes with timestamps makes it easier for other staff members to review the same section. In designs that send recordings to external services, also verify the storage destination and access scope.

If no waveform appears, check for module loading or audio decoding errors. If the waveform is displayed but no sound is heard, check the device volume, output destination, and playback permissions separately. When re-executing, there is a process to destroy the previous wavesurfer instance. The public learning material does not use actual meeting audio; operations are understood using artificial sound only.

Verification Scope

Material target: wavesurfer.js 7.9.1. The same WAV generation code as the implementation was executed on Node.js v22.16.0. Size is 96,044 bytes; maximum absolute amplitudes for intervals 0–2, 2–3, and 3–6 seconds are 1200, 13000, and 1200 respectively. The wavesurfer core and playback operations were not executed. Fetching external CDNs, fixed-version licenses with actual browser rendering, and Mermaid rendering were not verified.

References

GitHub Sample

Implementation and Experiment Procedure

Document information

Article title
Cueing Long Recordings from Waveforms with wavesurfer.js
Published
Updated
Source
https://papanda925.com/?p=19120&lang=en

License: Text and original figures for which this site holds the relevant rights are available under CC BY 4.0 , unless otherwise noted. This article may include content created or edited with generative AI. If code has a separate license notice or a linked GitHub repository license, that license takes precedence for the code. Quotations, third-party materials, images, and trademarks are excluded from this license. Usage policy

Copied title and URL