annotate audio/rawpipe.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 % rawpipe - audio signal from raw stream from shell pipe
|
samer@0
|
2 %
|
samer@0
|
3 % rawpipe ::
|
samer@0
|
4 % string ~'shell pipe',
|
samer@0
|
5 % AudioFormat~'stream format',
|
samer@43
|
6 % options(sndstream)
|
samer@0
|
7 % -> signal(C,R).
|
samer@0
|
8 %
|
samer@0
|
9 % If channels or rate are not nan, audio format will be converted to match.
|
samer@0
|
10 % If either of them are nan, the corresponding value from the audio file will
|
samer@0
|
11 % be left unchanged.
|
samer@0
|
12 function s=rawpipe(cmd,fmt,varargin)
|
samer@0
|
13 s=sndstream(@pipestream,'stringfn',@()sprintf('rawpipe(''%s'')',cmd),varargin{:});
|
samer@0
|
14
|
samer@0
|
15 function [str,cleanup]=pipestream(q)
|
samer@0
|
16 [str,cleanup]=pipein(cmd,q);
|
samer@0
|
17 str=javax.sound.sampled.AudioInputStream(str,fmt,-1);
|
samer@0
|
18 end
|
samer@0
|
19 end
|
samer@0
|
20
|
samer@0
|
21
|
samer@0
|
22
|