annotate arrows/audioplay.m @ 2:7357e1dc2ad6
Simplified scheduler library with new schedule representation.
author |
samer |
date |
Sat, 22 Dec 2012 16:17:51 +0000 |
parents |
672052bd81f8 |
children |
beb8a3f4a345 |
rev |
line source |
samer@0
|
1 function a=audioplay(ch,rate,window,varargin)
|
samer@0
|
2 if nargin<3, window=[]; end
|
samer@0
|
3 opts=prefs('buffer',1,'queue',4,'dspargs',{},varargin{:});
|
samer@0
|
4
|
samer@0
|
5 a=asysobj(@(sz)dsp.AudioPlayer(rate,'BufferSizeSource','Property', ...
|
samer@0
|
6 'BufferSize', opts.buffer*sz{1}(1), ...
|
samer@0
|
7 'QueueDuration',opts.queue*sz{1}(1)/rate, ...
|
samer@0
|
8 opts.dspargs{:}), ...
|
samer@0
|
9 1,0, @(sz){});
|
samer@0
|
10
|
samer@0
|
11 if ~isempty(window), a=arr(@(x)x(window,:))*a; end
|
samer@0
|
12 end
|
samer@0
|
13
|