Mercurial > hg > ishara
view audio/rawpipe.m @ 44:3cedfd4549ef
Code added since initial check in.
author | samer |
---|---|
date | Tue, 13 Jan 2015 14:03:17 +0000 |
parents | 62e31e7980e6 |
children |
line wrap: on
line source
% rawpipe - audio signal from raw stream from shell pipe % % rawpipe :: % string ~'shell pipe', % AudioFormat~'stream format', % options(sndstream) % -> signal(C,R). % % If channels or rate are not nan, audio format will be converted to match. % If either of them are nan, the corresponding value from the audio file will % be left unchanged. function s=rawpipe(cmd,fmt,varargin) s=sndstream(@pipestream,'stringfn',@()sprintf('rawpipe(''%s'')',cmd),varargin{:}); function [str,cleanup]=pipestream(q) [str,cleanup]=pipein(cmd,q); str=javax.sound.sampled.AudioInputStream(str,fmt,-1); end end