view audio/filesink.m @ 61:eff6bddf82e3 tip

Finally implemented perceptual brightness thing.
author samer
date Sun, 11 Oct 2015 10:20:42 +0100
parents 62e31e7980e6
children
line wrap: on
line source
% filesink - sink which writes a signal to a WAV file
% filesink :: C:natural, R:real, path, options {...} -> sink(C,R).
function s=filesink(ch,rate,file,varargin)
	str=sprintf('filesink(''%s'')',file);
	s=wavsink(ch,rate,@()filestream(file),@()str,varargin{:});
end

function [str,disp]=filestream(file)
	import  java.io.*;
	str=BufferedOutputStream(FileOutputStream(jfile(file)));
	disp=@nop;
end