view audio/audio_format.m @ 13:03694e5c8365

Reorganised some high order list functions to correct class-based method dispatch; fixed some docs.
author samer
date Wed, 16 Jan 2013 12:12:34 +0000
parents 672052bd81f8
children
line wrap: on
line source
% audio_format - make javax.sound.sampled.AudioFormat object
%
% audio_format :: 
%    N:natural ~'number of channels',
%    R:nonneg  ~'sampling rate in Hz'
% -> javax.sound.sampled.AudioFormat.

function f=audio_format(channels,rate,bits,bigendian)
	if isnan(channels), channels=-1; end
	if isnan(rate), rate=-1; end
	if nargin<3, bits=16; end
	if nargin<4, bigendian=false; end
	f=javax.sound.sampled.AudioFormat(rate,bits,channels,true,bigendian);