取消
显示结果 
搜索替代 
您的意思是: 

Sound .wav help

I need a little help.
 I want to open a .wav file and play it repeatedly.
Attached is a .vi.
What is happening is it will not play 1 time wait for a specific amount of time and play again, it plays 2.5 times give or take when repeating.



LV 8.2.1
Win XP pro (sp2)
0 项奖励
1 条消息(共 11 条)
5,865 次查看

Hello RRRRSSSS,

Have you gotten a chance to look at the shipping examples that come with LabVIEW?  There are some from the Example Finder that I think may work in this situation (trying to play a file continuously).

Look at Play Sound.vi, which plays a sound using the sndPlaySound Windows API. This demonstrates how to use the Call Library Function to call a DLL.

Sound File to Sound Output.vi also illustrates how to play a sound file continuously, reading the sound file in pieces, and playing each piece at a time.

Good luck!

Janell R | applications engineer

0 项奖励
2 条消息(共 11 条)
5,831 次查看

"Sound file to sound output "is what my vi is made from, the example only play's  once.

 I made an attempt to modify it and cannot get it to play once and repeat.

0 项奖励
3 条消息(共 11 条)
5,821 次查看
Have you tried simply using the "Play Sound File" function instead of all the code you're currently using? I set up a simple loop to do that and it played repeatedly. Got kind of annoying to hear "TADA!" every few seconds.
4 条消息(共 11 条)
5,809 次查看

I did not find a " Play sound file' , I found a 'Play sound" example.

In addition to what I have I need to be able to set the volume, which does not seem possible in "play sound".

I have a working program with the older LV 6.1 sound files, but I was wanting to use the 8.2 vi 's , figured just replace them and it would be good to go but this has not been the case. 

 

0 项奖励
5 条消息(共 11 条)
5,796 次查看

Hi RRRRSSSS,

See attached image. The idea is to read the WAV file and then run the sound data in a loop. You could keep loop delay to 1ms. In my case 10ms worked fine.

I could get my sound data to play as long as I hit the 'Stop' button.

Hope this helps.

- Gurdas

Gurdas Sandhu, Ph.D.
ORISE Research Fellow at US EPA
6 条消息(共 11 条)
5,793 次查看
The "Play Sound File" function is in the "Graphics & Sound -> Output" palette. It's the function in the lower right-hand corner. It's labeled "Play Sound", but the actual name is "Play Sound File". Since you need to set the volume as well then this won't work for you, as it plays the sound at max value.

Regardless, in your VI if you delete the "Sound Output Start" and "Sound Output Stop" then the VI works as expected. At least it did on my machine.

Side-note: You can use the "Time Delay" express VI (in the Timing palette) to get a wait function that has error in/out clusters to help you eliminate that sequence frame.
7 条消息(共 11 条)
5,785 次查看

The soundOutput.vi file is exactly what I wanted done except I need to add something to the code which would search for a wav file in a folder and then play it.

 Any help would be appreciated. I am new to Labview and I have no idea how to start it.

 

Thanks

0 项奖励
8 条消息(共 11 条)
5,075 次查看
Continued here...
0 项奖励
9 条消息(共 11 条)
5,053 次查看

I leave an example which can contribute

0 项奖励
10 条消息(共 11 条)
4,390 次查看