08-12-2014 01:40 PM
Hey guys,
I have a .wav file I am reading and outputting to speakers. I am a little confused over the rates of reading vs. outputting. I know they both want to be the same (around 48 kHz), but I don't know how to configure both. I can configure the sample rate (the rate at which the signal goes to the hardware) through the daqmx timing subvi, but I don't know how to set the hardware to output at the same rate.
I am assuming these rates are not correct because when I play my .wav file through the computer it sounds better than when I play it through my daq 4461 card (analog out) connected to my speaker.
Thanks
08-12-2014 01:49 PM - edited 08-12-2014 01:50 PM
Hi monkeys,
"it sounds better than"
Use better speakers on your DAQ card to improve sound quality… 😄
- Use the waveform sample rate to set the sample rate of your DAQmx task!
- For DAQmxTiming exist a setting to take sample rate of waveform automatically…
Right now you set some arbitrary sample rate and an arbitrary clock source - we can't see both values!
What's the purpose of the inner while loop?
08-12-2014 01:57 PM
08-12-2014 01:57 PM
So I don't have a task because I just have a channel and I am reading a .wav file right? The speakers are good speakers and I am playing pink noise so all I can tell is that it doesn't sound right haha. The point of the 2 while loops is my ability to change the volume and have the signal continue to output. In other words, I don't have to re-run the program every time I want to change the volume. Here is my front panel... I know the scale is wrong for the graph.
08-12-2014 02:08 PM
08-12-2014 02:09 PM
Hi monkeys,
- you don't need to set a clock source here
- you want to output an array of waveforms on just one AO channel? Either select more output channels or output just one waveform…
- Use DAQmxTiming with "Use waveform" option…
What volume values do you use (other than 1)?
08-12-2014 02:18 PM
I like to vary the output from 1,2,3,4,...etc. to get different voltages to my speakers. If I don't use a clock source and I just select "use waveform" then the two wires don't connect because my source (.wav file) is 1D array of waveforms. I don't know why a pink noise .wav file is 1D array of waveforms.
08-12-2014 02:45 PM - edited 08-12-2014 02:47 PM
08-12-2014 02:49 PM
Yes, I used index array and put it into the daqmx timing set to waveform and it reports an error when I run it
08-12-2014 02:56 PM