File: Export: Sound (WAV)
Export data as Microsoft PCM wave file
expWAV fname:="sound.wav";
Please refer to the page for additional option switches when accessing the x-function from script
Input
int
This variable specifies the channel mode. Option list
Worksheet
Specify the input range to be converted to WAV
Specify which column of the worksheet is the left channel. And it will represent the Channel when Channel Mode selected as moto.
Specify which column of the worksheet is the Right channel. It is only avaliable when Channel Mode selected as Stereo
The begin of the data to be exported
The end of the data to be exported
string
Specify the path and filename of the output WAV file
Specify the Sample Bits of the output WAV file Option list
The expWAV function exports worksheet data as Microsoft PCM wave file. It can be accessed from menu or command window
Noted that the value of the Sampling Interval in the worksheet must be larger than 22Hz.
/* This script shows how to import a sound wave file and do some processing then export the result. The sample data is located in exe_path\Samples\Signal Processing\. 1. Import a wav file to a new book. 2. Perform low-pass filters on the data to remove the high frequency part of the sound. 3. Export the data to a new wav file. */ // Import the wav file fname$ = system.path.program$ + "Samples\Signal Processing\sample.wav"; newbook s:=0; newsheet col:=1; impWav options.SparkLines:=0; string bkn$=%H; // Remove the high frequency part fft_filters [bkn$]1!col(1) cutoff:=2000 oy:=(<input>,<new name:="Low Frequency of the Sound">); // Set the new wav column's format to be short(2) type wks.col2.format=1; wks.col2.numerictype=3; // Export to a new wav file; fname$=""; expWav iw:=[bkn$]1 left:=2;