filoe / cscore

An advanced audio library, written in C#. Provides tons of features. From playing/recording audio to decoding/encoding audio streams/files to processing audio data in realtime (e.g. applying custom effects during playback, create visualizations,...). The possibilities are nearly unlimited.
Other
2.15k stars 451 forks source link

[Question] Can’t close app while sound is playing #411

Closed steam3d closed 4 years ago

steam3d commented 4 years ago

I learn this example AudioPlayerSample

I set the source mp3 file and play it. _musicPlayer.play()

While music is playing I click close window button. Window closed, but music still playing. Only when music ended the app is completely closed.

How do I fix this?

filoe commented 4 years ago

You have to stop the soundOut instance and dispose it in order to close the process completely.

Most soundOut providers are running background threads.

Von: Alexander Maslov notifications@github.com Gesendet: Donnerstag, 30. April 2020 20:20 An: filoe/cscore cscore@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Betreff: [filoe/cscore] [Question] Can’t close all while sound is playing (#411)

I learn this example AudioPlayerSample https://github.com/filoe/cscore/tree/master/Samples/AudioPlayerSample

I set the source mp3 file and play it. _musicPlayer.play()

While music is playing I click close window button. Window closed, but music still playing. Only when music ended the app is completely closed.

How do I fix this?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/filoe/cscore/issues/411 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHXVYIAKAJL34MV2MPMYILRPG6MFANCNFSM4MWGLULQ .