fix: clear previous waveform before starting a new recording
Overview
This merge request resolves an issue where the waveform from a previous recording remained visible when a user started a new recording. The waveform visualization was not being properly reset, causing stale waveform data to persist across recording sessions.
Changes Implemented
- Added proper cleanup of existing WaveSurfer instances before initializing a new recording session.
- Cleared waveform container contents during recording initialization.
- Reset audio-related state and references associated with previous recordings.
- Improved WaveSurfer lifecycle management to prevent stale waveform rendering.
- Ensured only the active recording's waveform is displayed in the UI.
Issue Addressed
Previously, when users recorded multiple audio clips consecutively, the waveform from the earlier recording remained visible, resulting in an inconsistent and confusing user experience.
Testing Performed
- Recorded multiple audio clips sequentially and verified waveform reset behavior.
- Confirmed that previous waveforms are removed before a new recording begins.
- Validated that only one WaveSurfer instance is active at any time.
- Verified that waveform visualization updates correctly for each recording session.
Screenshots
Result
The waveform visualizer now correctly resets between recordings, ensuring a clean recording experience and preventing stale waveform artifacts from appearing in the interface.
closes #52 (closed)
