### user You are a code expert. Please use your professional knowledge to generate accurate and professional responses. Be sure to provide executable code when possible. Develop a frontend program for audio trimming and labeling, where users can upload audio, trim specific time segments, add text labels to the trimmed audio, and finally save the audio file with the label information. ### assistant · thinking The user wants a frontend program for audio trimming and labeling. I should produce a complete, executable HTML/CSS/JS solution. Let me build a single-page app with: 1. Audio upload (file input / drag-drop) 2. Waveform visualization (canvas) - can use Web Audio API decodeAudioData to draw waveform 3. Trim selection - draggable handles on waveform or input fields for start/end time 4. Playback preview with play/pause, loop over selection 5. Add text labels at timestamps 6. Export: trimmed audio as WAV (encode with OfflineAudioContext or manual PCM encoding) plus label info JSON Let me design carefully. Key technical pieces: - `AudioContext.decodeAudioData` to get AudioBuffer - Draw waveform on canvas from channel data (peaks) - Selection: two handles, drag with mouse; also region drag to select - Labels: store array of {time, text} — positions relative to trimmed audio (or absolute? better relative to trimmed clip) - Playback: use AudioBufferSourceNode with offset/duration; or use an