Unassign an invalid Webfile URL from a WebAudioPlayer

Hi,

I am using a WebAudioPlayer object to play a “.wav” file. I first read it with a BinaryStream, then create a Webfile object with its data and assign that Webfile’s URL to the WebAudioPlayer.URL proprety to allow playback. This works fine.

However, I have problems when trying to remove the URL reference from the WebAudioPlayer. When I hide the control in which the WebAudioPlayer is, I also delete the Webfile’s reference. Therefore, to prevent the user from trying to play a non-existent Webfile, I set the WebAudioPlayer.URL property to “”.

When I do that, the player displays “error”, which I do not want. Is there any way to work around this behaviour?

Thanks,

Simon

I have no experience with the WebAudioPlayer.
I guessed that the URL is “” if there is no URL assigned.
Not sure how to make it show “error”.
Can you create a sample project, zip it and upload here?

How about making a wav file that has no audio in it and assigning that instead. I bet you could get its size very close to zero K.

There’s a GitHub repository with silence files somewhere. I use the mp3, but I am on my phone so no link handy.

1 Like