Crunchy-Downloader/CRD/Utils/AudioPlayer.cs
Elwador aca28a4e17 Add - Added option to **mux fonts into the MKV**
Add - Added **completion sound** when downloads finish, allowing a specified sound to be played
Add - Added **changelog** for easier tracking of changes and updates
Add - Added **Retry button** to reset all failed downloads, allowing "Auto Download" to restart them
Add - Added **dub/sub info** to the Upcoming tab
Chg - Changed **history table view** to include missing features from the poster view
Chg - Changed and **adjusted error messages**
Chg - Changed **chapters formatting** for consistent output across locales
Chg - Changed **Clear Queue** button to icon-only
Chg - Changed **update button** behavior
Chg - Changed some **error messages** for better debugging
Chg - Changed **history series access**, now allowing it to open while others are refreshing
Chg - Changed **device ID reuse** to fix continuous login emails
Chg - Changed **authentication log** to write the full message for better debugging
Chg - Updated **dependencies**
Fix - Temporary fix for **authentication issues**
Fix - Fixed **unable to download movies** [#237](https://github.com/Crunchy-DL/Crunchy-Downloader/issues/237)
Fix - Fixed **buggy queue behavior** during active downloads
Fix - Fixed **duplicate seasons in history** when adding multiple episodes from the calendar
Fix - Fixed crash if  **all** subtitles option is selected
Fix - Fixed "**Cannot set download directory to Drive**" https://github.com/Crunchy-DL/Crunchy-Downloader/issues/220
Fix - Fixed missing **subtitles and none subs** for some series
2025-04-04 20:12:29 +02:00

29 lines
No EOL
602 B
C#

using System;
using NetCoreAudio;
namespace CRD.Utils;
public class AudioPlayer{
private readonly Player _player;
private bool _isPlaying = false;
public AudioPlayer(){
_player = new Player();
}
public async void Play(string path){
if (_isPlaying){
Console.WriteLine("Audio is already playing, ignoring duplicate request.");
return;
}
_isPlaying = true;
await _player.Play(path);
_isPlaying = false;
}
public async void Stop(){
await _player.Stop();
_isPlaying = false;
}
}