07-06-2017 04:04 PM
I have some waveforms saved in .tdms files. I want to convert them to .wav audio files. In DIAdem, I'd did 'Save As' then chose 'Audio .wav'. When I open the .wav file up in an audio player/editor, it is silent; it's just an empty line.
Now, my original .tdms waveform data goes from ~[-2,2]. When I scale the waveform in DIAdem down to ~.30, the .wav file then behaves properly. Is there a different way for me to avoid this issue? Is this due to some sort of specifications of the .wav file format? I attached some pictures.
Solved! Go to Solution.
07-07-2017 08:19 AM
Note: I think what I am doing is part of the Audio Dataplugin
07-07-2017 10:57 AM - edited 07-07-2017 10:58 AM
Hi sj,
You either have to scale the waveform channels to the I32 data values yourself or happen to be in a valid scaling range for the WAV file format. I find the former approach easier to remember:
Volume = 0.5 ' 0.0 - 1.0 FOR Each Channel In Data.GetChannels("*") Amplitude = MaxV(Abs(CMin(Channel)), CMax(Channel)) Call ChnLinScale(Channel, Channel, Volume*2^31/Amplitude, 0) Call ChnCharacter(Channel) NEXT Call DataFileSave(WavFilePath, "Audio")
Brad Turpin
DIAdem Product Support Engineer
National Instrument