Functions | |
function | playaudio (name, ext) if(nargin |
if (nc!=1) if(nr | |
else | error ("playaudio: X must be a vector") |
fclose (num) | |
system (sprintf("cat \"%s\" > /dev/dsp", file)) | |
unwind_protect_cleanup | unlink (file) |
end_unwind_protect | elseif (nargin >=1 &&ischar(name)) if(nargin |
elseif (nargin==2) name | |
else | print_usage () |
endif | if (strcmp(ext,"lin")||strcmp(ext,"raw")) system(sprintf("cat \"%s\" > /dev/dsp" |
elseif (strcmp(ext,"mu")||strcmp(ext,"au")||strcmp(ext,"snd")||strcmp(ext,"ul")) system(sprintf("cat \"%s\" > /dev/audio" | |
else | error ("playaudio does not support given extension") |
Variables | |
function | nc = size (name) |
nr = nc | |
endif endif | X = name + 127 |
unwind_protect | file = tmpnam () |
num = fopen (file, "wb") | |
c = fwrite (num, X, "uchar") | |
end_unwind_protect | lin |
endif | name = printname |
elseif | ( | strcmp(ext,"mu")||strcmp(ext,"au")||strcmp(ext,"snd")||strcmp(ext,"ul") | ) |
elseif | ( | nargin | = =2 |
) |
end_unwind_protect elseif | ( | nargin >=1 && | ischarname | ) |
else error | ( | "playaudio: X must be a vector" | ) |
fclose | ( | num | ) |
endif if | ( | strcmp(ext,"lin")||strcmp(ext,"raw") | ) |
if | ( | nc! | = 1 |
) |
else print_usage | ( | ) |
system | ( | sprintf("cat \"%s\" > /dev/dsp", file) | ) |
unwind_protect_cleanup unlink | ( | file | ) |
c = fwrite (num, X, "uchar") |