Home > freetb4matlab > audio > ausave.m

ausave

PURPOSE ^

% error: ausave('filename.ext', x, fs, format)

SYNOPSIS ^

function ausave(path, data, rate, sampleformat)

DESCRIPTION ^

% error: ausave('filename.ext', x, fs, format)
%
% Writes an audio file with the appropriate header. The extension on
% the filename determines the layout of the header. Currently supports
% .wav and .au layouts.  Data is a matrix of audio samples in the
% range [-1,1] (inclusive), one row per time step, one column per 
% channel. Fs defaults to 8000 Hz.  Format is one of ulaw, alaw, char, 
% short, long, float, double
%
% Note that translating the symmetric range [-1,1] into the asymmetric
% range [-2^n,2^n-1] requires a DC offset of -2/2^n.  The inverse 
% process used by auload requires a DC offset of 2/2^n, so loading and 
% saving a file will not change the contents.  Other applications may 
% compensate for the asymmetry in a different way (including previous 
% versions of auload/ausave) so you may find small differences in 
% calculated DC offsets for the same file.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Sat 16-May-2009 00:04:49 by m2html © 2003