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
	
