Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'error' event is not returning any message for invalid decoding #3963

Open
gilpanal opened this issue Dec 18, 2024 · 0 comments
Open

'error' event is not returning any message for invalid decoding #3963

gilpanal opened this issue Dec 18, 2024 · 0 comments
Labels

Comments

@gilpanal
Copy link

gilpanal commented Dec 18, 2024

Bug description

Try to load a not supported type of audio, like .ogg in Safari
The error event is triggered but the content of the message is undefined.
It seems also that the event throws the error message correctly later when tries to load a different file that is compatible

Environment

  • Browser: Any

Minimal code snippet

<script src="https://unpkg.com/wavesurfer.js@7"></script> 

wavesurfer.load('assets/audio/wrong_format.m4a');

wavesurfer.on('error', (error) => {
  console.log(error)
  // try to load a different file after the error
   wavesurfer.load('assets/audio/sample.mp3');
});

Easy to reproduce by running the following repo, changing the library version in the index.html and adding the error event handler snippet code above:

https://github.com/HassanCorrigan/soundcloud-player

Expected result

With the following previous version it works as expected:

 <script src="https://unpkg.com/[email protected]/dist/wavesurfer.js"></script>

Outoput: "Error decoding audiobuffer"

In the current version it should be the following message
EncodingError: Unable to decode audio data

Obtained result

undefined

NOTE: after that, if another compatible audio file is loaded then the message is displayed in the error handler event but it shouldn't

Screenshots

@gilpanal gilpanal added the bug label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant