view 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
line wrap: on
line source
function a=audioplay(ch,rate,window,varargin)
	if nargin<3, window=[]; end
	opts=prefs('buffer',1,'queue',4,'dspargs',{},varargin{:});

	a=asysobj(@(sz)dsp.AudioPlayer(rate,'BufferSizeSource','Property', ...
					'BufferSize',   opts.buffer*sz{1}(1), ...
					'QueueDuration',opts.queue*sz{1}(1)/rate, ...
					opts.dspargs{:}), ...
			1,0, @(sz){});

	if ~isempty(window), a=arr(@(x)x(window,:))*a; end
end