Home > freetb4matlab > audio > auload.m

auload

PURPOSE ^

%

SYNOPSIS ^

function [data, rate, sampleformat] = auload(path)

DESCRIPTION ^

% -*- texinfo -*-
% @deftypefn {Function File} {[@var{x},@var{fs},@var{sampleformat}] =} auload (@var{filename})
%
% Reads an audio waveform from a file given by the string @var{filename}.  
% Returns the audio samples in data, one column per channel, one row per 
% time slice.  Also returns the sample rate and stored format (one of ulaw, 
% alaw, char, int16, int24, int32, float, double). The sample value will be 
% normalized to the range [-1,1] regardless of the stored format.
%
% @example
%    [x, fs] = auload(file_in_loadpath('sample.wav'));
%    auplot(x,fs);
% @end example
%
% Note that translating the asymmetric range [-2^n,2^n-1] into the 
% symmetric range [-1,1] requires a DC offset of 2/2^n. The inverse 
% process used by ausave 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.
% @end deftypefn

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Fri 22-May-2009 15:13:00 by m2html © 2003