VB如何检查计算机中是否正在播放任何音频 [英] VB How to check if any audio is being played in computer
问题描述
我正在制作一个在后台播放音乐的应用程序.差不多完成了,我只想检查计时器是否播放了来自其他任何应用程序或计算机声音的其他音频,并暂停了我的音乐
I am making a app which plays music in background. Its almost done, i just want to check if any other audio from any other app or computer sound is played through a timer and pause my music
我使用Windows Media Player控件来暂停它,但我只是不知道如何检查计算机上是否运行了其他音频.
I use windows media player controls so i can pause it, but I just don't know how to check for any other audio running in computer.
有办法吗?
我将创建一个间隔为0.1秒的计时器,并且我有一个PauseMusic函数,如果正在播放音乐,则应调用该函数,一旦音乐结束,则应调用PlayMusic.
I will make a timer with interval at 0.1 second and I have a function PauseMusic which should be called if music is playing and PlayMusic once the music is over.
推荐答案
Visual Basic不适用于那些专用于硬件的解决方案.您必须使用非托管的低级程序语言,例如C,C ++或ASM.
Visual Basic is not made for those hardware dedicated solutions. You have to use non managed low level program languages likewise C, C++ or ASM.
这篇关于VB如何检查计算机中是否正在播放任何音频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!