Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

play a .wav file using myrio

 

i want to play  .wav audio file on myrio...my current program plays the .wav file on a pc..but i want to use the audio out  port on myrio to play it.....i need ideas on how to proceed further... 

 

i tried changing the play waveform vi...but i was getting an error stating that sound file read simple vi doesnt work on myrio....

 

need help ASAP..

 

 

 

Download All
0 Kudos
Message 1 of 3
(6,062 Views)

I have the same doubt... I always get an error when opening the .wav file

I am using (/home/lvuser/....wav) this path.

The code is apparently correct because the arrow is not broken.. so I think i may have the wrong path.. But i have tried it in so many ways but with no succed.

Thank you so much for the help

0 Kudos
Message 2 of 3
(5,971 Views)

Hi,

 

It looks like to me, MyRio doesn't directly play .wav file, you need to process it first on your PC to convert .wav into 2 arrays: left audio and right audio.

 

In the first figure, I simply read a wav file and save it into "data".

 

In the second figure, under "data" you will be able to find 2 arrays (the "Y" array), which correspond to left audio and right audio. Simply copy them and paste to a new vi under myrio.

 

In the third figure, use express VI "analogue output" and pick "audio out/left", "audio out/right", string two arrays into them, then myrio will be able to play!

 

Note since wav is not compressed, the arrays of a complete song will be very long, myrio has limited memory, so probably won't be able to play a complete song (about 1min maybe good).

 

0 Kudos
Message 3 of 3
(3,556 Views)