05-05-2008 04:13 AM
05-05-2008 01:24 PM
Hi Frrranky,
I would have expected that to work. I have had very good experiences with the Audio DataPlugin. If you can post one of these WAV files, I'll be happy to see if I can reproduce the problem and then forward the file on to R&D to adjust the DataPlugin.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
03-23-2010 07:02 AM
Hi,
I have a similar problem to export data files to .WAV format with Audio Dataplugin (http://zone.ni.com/devzone/cda/epd/p/id/44) in DIAdem 10.2 or DIAdem 11. I have signals (in Pascals) acquired with microphones (with a sampling rate = 41000 Hz). But when I open the .WAV file I get an error message.
Do you Know what I'm doing wrong?
Thanks in advance.
03-24-2010 12:14 PM
Hi asanchez3,
I'm confused, are you trying to use the Audio DataPlugin to import the WAV file into DIAdem or to export DIAdem data channels to a WAV file? You used both verbs in your post.
Regardless, this should work. Would you please post a sample WAV file or DIAdem data set, whichever is your starting point? If you prefer you can instead send the data file to brad.turpin@ni.com.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
03-25-2010 05:52 AM
Hello Brad,
I would like to export data file (DIAdem DAT files) toWAV file with DIAdem Audio Dataplugin (http://zone.ni.com/devzone/cda/epd/p/id/44), Ihave signals (in Pascals) acquired with microphones (with a sampling rate =41000 Hz). But when I open the .WAV file I get an error message.
I attach a .DATfile with the original signal and the WAV file obtained with the AudioDataPlugin (this file can not be opened with any audio player).
Thanks!
Adrià.
03-25-2010 10:52 AM
Hi Adrià,
Thanks for the data set, I now know what was going wrong. It was actually quite easy to debug the problems in my DIAdem 2010 Alpha version, which sports a new feature to play back any channel in the Data Portal as audio.
There were 2 issues. The first is that you have to add a time base to the data channel before you export it, the second is that you have to rescale the amplitude of the signal to the bit range (+/- 2^31) of a WAV file. Here's a quick VBScript that does that, which I did test in DIAdem 10.2:
Channel = 1
WavFilePath = ChnPropValGet(Channel, "sourcedatafilepath") & ChnPropValGet(Channel, "sourceparentname") & ".wav"
Call ChnWfPropSet(Channel, "Time", "s", 0, 1/41000)Amplitude = MaxV(Abs(CMin(Channel)), CMax(Channel))
Call ChnLinScale(Channel, Channel, 2^31/Amplitude, 0)
Call ChnCharacter(Channel)
IF FilEx(WavFilePath) THEN Call FileDelete(WavFilePath)
Call DataFileSave(WavFilePath, "Audio")
Brad Turpin
DIAdem Product Support Engineer
National Instruments
03-25-2010 11:36 AM
Hi Brad,
You found the right answer for me.
Thank you for your useful help!!
Adrià.
10-28-2010 03:36 AM - edited 10-28-2010 03:36 AM
That helped me a lot, I would even say this is a good base for a knowledgebase entry.
Another question: how to get the scaled TDM saved with "WAV GPI Filter"? I only get corrupted scratch sounds, the WAV GPI Filter does work with the example files, when setting amplitudes to min=-1 max=1.
10-28-2010 01:48 PM
Hi Ilja,
Why would you be using the "WAV GPI Filter"? What version of DIAdem do you have? DIAdem versions 9.1 and later can use DataPlugins, and DIAdem 10.0 and later support waveform channels. Have you tried using the "Audio" DataPlugin to export the data set to *.WAV file?
Brad Turpin
DIAdem Product Support Engineer
National Instruments
10-29-2010 03:05 AM - edited 10-29-2010 03:09 AM
Hello Brad,
you are totallay right. Nevertheless, one of my customers would like to use the WAV GPI Filter, which offers a dialog with settings. Changing them does generate the appropriate wav-file.
In case with Audio DataPlugin you have to add group properties
Audio DataPlugin
http://zone.ni.com/devzone/cda/epd/p/id/44
Writing audio files:
I am using DIAdem 11.2.0f4178
Well, I manage to add property "Sampling_Rate", the value have to be of integer type, then exporting with changed sampling rate works.
Adding "Bits_Per_Sample" property with an integer value generates a wav file which cannot be played or opened in an audio editor.
For example, when I modify the original audio file with Audacity to 16 Bits per Sample, the file has the same size, as when exported with DIAdem, with the difference the DIAdem generated audio cannot be played.
I was experimenting with the DIAdem example data, I am not sure what is the equivalent in English version, it should be "Sound_1" (car engine starting), please excuse all the German expressions in my screenshots.
Still one last question, why there is no need to rescale the example audio data (e .g . "Sound_1") and exporting to WAV still works, while having amplitudes from ca. 0.6 to -0.6
In case with the customer´s audio data, which has been rescaled through the VBScript, you necessarily need amplitudes from 1.6E9 to -2.1E9
Thank you very much in advance
Best regards