annotate audio/sndread.m @ 61:eff6bddf82e3 tip

Finally implemented perceptual brightness thing.
author samer
date Sun, 11 Oct 2015 10:20:42 +0100
parents 62e31e7980e6
children
rev   line source
samer@43 1 % sndread - read entire contents of any audo file readable by sndfile
samer@0 2 function X=sndread(file,FS,varargin)
samer@37 3 opts=options('bs',1024,varargin{:});
samer@0 4 sig=sndfile(file,opts);
samer@0 5 i=info(sig);
samer@0 6 if isfinite(i.length), init=ceil(1.01*i.length*rate(sig)/opts.bs);
samer@0 7 else init=fs; end
samer@0 8 X=gather(sig,'chunk',opts.bs,'init',init);
samer@0 9