% sndpipe - audio signal from shell pipe line.
% sndpipe :: string~'shell command', options(sndstream) -> signal(C,R).
%
% The shell command must produce a self-describing stream that can be recognised
% by the JavaSound subsystem. Then,
function s=sndpipe(cmd,varargin)
	s=sndstream(@pipestream,'stringfn',@()sprintf('sndpipe(''%s'')',cmd),varargin{:});

	function [str,cleanup]=pipestream(q)
		[str,cleanup]=pipein(cmd,q);
		str=austream(str);
	end
end



