- As prerequisite you will need one single waveform channel in the first group in DIAdem dataportal
- Once the data is loaded go to the Script tab in DIAdem
- Copy the following code into a new vbs script and save it or load the attached script in the attachment section.
'-------------------------------------------------------------------------------
' This vbs script exports the first channel in the dataportal as .wav file.
'-------------------------------------------------------------------------------
Option Explicit 'Forces the explicit declaration of all the variables in a script.
'variables decalaration
dim Bits
dim Rate
dim Amplitude
Bits = 32 'bits value could be also 16 or 24
Rate = "" 'set Rate to empty
IF Rate <> "" OR NOT IsNumeric(Rate) THEN Rate = 1/ChnPropValGet(1, "wf_increment") 'calculation of the sampling rate of channel 1
Call GroupPropValSet(1, "Bits_Per_Sample", CLng(Bits))' adding bitrate property to channel group 1
Call GroupPropValSet(1, "Sampling_Rate", CLng(Rate))' adding sampling rate property to channel group 1
Amplitude = MaxV(Abs(CMin(1)), Abs(CMax(1)))' calculation of maximal amplitude of original waveform
Call ChnLinScale(1,1,2^(Bits-1)/Amplitude,0) 'scaling of the orginal waveformcahnell to new bitness
Call DataFileSave(AutoActPath & "Diadem Wave " & Bits & " - " & Rate & ".wav", "Audio") ' save .wav next to this script location
- Run the Script