C
C#2y ago
Donut5162

❔ Closing media with MediaPlayer

Hello, I am trying to make an audio player that also allows the user to edit tag metadata using TagLib#. When the user inputs their desired changes to the tag and clicks confirm, it should close the media, save the changes to the file, then open the media again. The problem is that Close() seems to asynchronously close the media player, so by the time it is trying to save the changes to the file, the file sometimes is still being closed and is therefore in use by that other process, causing the save to fail. There does not seem to be a 'MediaClosed' event for the MediaPlayer class, even though there is a 'MediaOpened' event. If there was, I would use that. I cannot use 'await', either. Any ideas how I can go about this?
1 Reply
Accord
Accord2y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.

Did you find this page helpful?