SndLoadWave and PlaySound
kperks
However, for my experiment I need to play an auditory stimulus while making a whole-cell recording in Igor.
I successfully imported a .WAV file into an Igor wave, but when I go to play it using the Waveform Generator (NIDAQmxWaveFOrmGenProcs.ipf, I believe) I get an error that: "While starting Waveform Generator: NI-DAQmx driver error while calling function DAQmxWriteAnalogF64;
device NI6259:-200561: Measurements: Attempted writing analog data that is too large or too small."
Indeed, the wave that was created when I used SndLoadWave has minVal=-11110, maxVal=9753
I cannot figure out how to scale this wave (using setscale ?... I use the format: setscale y, -10,10, data1), nor how to make it import within a specified range V_min, V_max (I have not found a function that can perform this, nor a flag option to set it within the SndLoadWave operation)
I hope someone can help.
Best,
Krista
But PlaySound is not working.
Has anyone used this function?
July 20, 2010 at 11:46 am - Permalink
The values in your wave that you want to send to the waveform generator should be volts. In general, most NI devices have an analog output range of +-10V, some have somewhat larger, some have somewhat smaller. So you need to scale your sound values into floating-point values that express voltages that are appropriate for whatever device you are sending the sounds to.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
July 20, 2010 at 04:20 pm - Permalink