12-14-2016 10:12 AM
Hi there,
I'm working on a piano project, I'm using labview to play musical notes when a key is depressed.
I tried to use "Sound Output write", but it seems that this function is blocking, the sound card plays the next file only after the previous one ends. So if I depress many keys at the same time, sound files get stuck in sound card.
I also tried to use "Play sound files", it isn't blocking, but when I depree the key, there's a tiny delay before playing. Pianoists from music department don't like this delay.
I'm wondering is there anyway I could solve blocking/delay problems? Which function shall I use?
Thank you in advance!
12-15-2016 04:11 PM
Hi Yatang,
It appears as though your code is trying to reference a file called "Note 12 Keys" and that this file is located on your desktop. Would you mind posting a link to this file so I can use it to try to better understand what might be causing this issue?
12-16-2016 02:22 AM
Welcome back, I thought this project sounded familiar: http://forums.ni.com/t5/LabVIEW/Can-quot-Play-Sound-Files-quot-plays-two-files-simultaneously/m-p/33...
Try wiring 0 into the timeout of the Sound Output Write.vi. That should cause it to begin playing and not block.
12-16-2016 01:54 PM
Hi Michael,
It seems that "Sound Output write" is still blocking even though I wire a 0 to timeout, it plays the sencond file only after the previous end.
12-16-2016 03:48 PM
Hi Letitsnow,
I attached those files. Please change the extension to .zip.
Do you know why "Play Sound File" will have a tiny delay before playing?
12-16-2016 05:09 PM
> Do you know why "Play Sound File" will have a tiny delay before playing?
Load the file I guess. If you play it again, there is no delay.