Multi-threaded background audio playback system, support for multi-sound card problems Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061025154318203.html
Currently, I ProgramDeveloped Using mmtools. However, when audio playback is frequent, an error occurs during creation and playback, leading to abnormal thread termination, in addition, the application is automatically closed without any prompts (fortunately, I wrote a log in the playback area to know that an error was reported during create and play ). Since mmtools still needs to be cracked and used, I changed it to API for playing. The voice of a single thread is normal, but after each sound is played, there will always be one more thread in the threads stack and its status is stop, in this way, frequent playback may cause program exceptions.
These threads are automatically generated after calling the waveoutwrite and waveoutopen functions. How can I capture the threadid to end, or use other methods to release background playback resources.
Waveoutclose