LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

StartPcSound

Solved!
Go to solution

       我编写的程序中调用StartPcSound(3000)发声,正常编译运行可以发声,直接运行exe文件也正常。我把这个文件添加到WINXP开始启动中,当计算机启动后自动运行此程序却没有发声,这个函数可定是执行了。退成程序后重新打开又可以了,为什么?????

0 Kudos
Message 1 of 6
(3,712 Views)
Solution
Accepted by topic author luoxinp

   My program is using StartPcSound(3000) function generate sound,direct run this program is ok.But add this program to WINXP start->startup ,when computer start up and run this program no sound. Why? Exit program and run again, sound ok.

0 Kudos
Message 2 of 6
(3,709 Views)

It is possible that your program starts before the sound subsystem has loaded during startup process. If this is the case, logging off and on again the user from the PC after initial startup should rerun the program and hopefully make the sound audible.

If this test is successfull you could either insert a pause in your program to permit complete loading of the system or move the sound in a function run with a PostDelayedCall with some seconds delay.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 3 of 6
(3,704 Views)

I had the same issue in the past and the problem was that the program was started before the services have been fully loaded.

I din't found a way to have it working, so I replaced StartPCSound with PlaySound() from Windows SDK

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 4 of 6
(3,698 Views)

Thank you !!

0 Kudos
Message 5 of 6
(3,678 Views)

Just out of curiosity, which one is the answer you consider to solve your question? Also, it would be a good thing if you can change the "solution" assignment so that future discussion readers can have a guidance on this subject,



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 6 of 6
(3,674 Views)