Skip to content

Improve audio file loading error handling and logging#16

Merged
ivgtr merged 1 commit intomainfrom
claude/fix-audio-player-display-BNrDa
Feb 9, 2026
Merged

Improve audio file loading error handling and logging#16
ivgtr merged 1 commit intomainfrom
claude/fix-audio-player-display-BNrDa

Conversation

@ivgtr
Copy link
Owner

@ivgtr ivgtr commented Feb 9, 2026

Summary

Enhanced error handling in the file input handler to provide better debugging information when audio file loading fails.

Key Changes

  • Removed premature player.ensureRunning() call that was executed before file loading, allowing the player to initialize naturally during the load process
  • Added error parameter to catch block for better error tracking and debugging
  • Added console error logging with descriptive message when audio file loading fails

Implementation Details

The player.ensureRunning() call was moved out of the try block since it was being called before the actual file load operation. This allows the player to be properly initialized as part of the loadFromBlob() operation rather than as a separate preliminary step. The error is now captured and logged to the console, making it easier to diagnose issues during development and troubleshooting.

https://claude.ai/code/session_01W4ZqXjt5v7W8B5hmP22Z1P

Remove unnecessary `ensureRunning()` call from the file input handler.
The `change` event from a file input may not qualify as a user activation
in some browsers, causing `AudioContext.resume()` to block or fail silently.
Since `decodeAudioData` and node creation work on a suspended context,
`ensureRunning()` is not needed here — it is already called when the user
clicks Play.

Also add `console.error` to the catch block for easier debugging.

https://claude.ai/code/session_01W4ZqXjt5v7W8B5hmP22Z1P
@ivgtr ivgtr merged commit c498cdc into main Feb 9, 2026
@ivgtr ivgtr deleted the claude/fix-audio-player-display-BNrDa branch February 11, 2026 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants