mobiletechtracker / NetCoreAudio

Allows playback of audio files on .NET Core with minimal dependencies
MIT License
124 stars 20 forks source link

Bug: PlaybackFinished event is raise before the audio stops #9

Open lastunicorn opened 4 years ago

lastunicorn commented 4 years ago

Platform: Windows

Steps to reproduce: 1) Instantiate Player 2) Subscribe to PlaybackFinished event 3) Play an mp3 file

Expected behaviour: PlaybackFinished event should be raised when audio stops.

Actual behaviour: After PlaybackFinished event is raised, audio still plays for 1 or 2 seconds.

Code example:

Player player = new Player();

player.PlaybackFinished += (sender, args) =>
{
   // This event is triggered even if the player still has 1 or 2 seconds to play.
};

player.Play(path);
fiodarsazanavets commented 2 years ago

Can you confirm whether you are still seeing this issue?

Rombersoft commented 1 year ago

Platform: Windows

Steps to reproduce:

1. Instantiate Player

2. Subscribe to PlaybackFinished event

3. Play an mp3 file

Expected behaviour: PlaybackFinished event should be raised when audio stops.

Actual behaviour: After PlaybackFinished event is raised, audio still plays for 1 or 2 seconds.

Code example:

Player player = new Player();

player.PlaybackFinished += (sender, args) =>
{
   // This event is triggered even if the player still has 1 or 2 seconds to play.
};

player.Play(path);

I've got the same problem when starting an application in DEBUG mode. And also you must add Wait() method after Play(path): player.Play(path).Wait();