## play with xonar u5
1; ## not a function file

devices = audiodevinfo ();
for idx = 1:max(size(devices.input))
  printf("%2d %s\n", devices.input(idx).ID, devices.input(idx).Name);
endfor

seconds = 5

disp("24-bit source============")
source = audiorecorder(192000, 24, 2, 4)
recordblocking (source, seconds);
A = getaudiodata(source);
disp(size(A));
disp(max(A));
disp(min(A));
stop(source);
disp("");
disp("16-bit source============")
source = audiorecorder(192000, 16, 2, 4)
recordblocking (source, seconds);
A = getaudiodata(source);
disp(size(A));
disp(max(A));
disp(min(A));
stop(source);

N = max(size(A));
X=linspace(0,5,N);

subplot(2,1,1);
plot(X,A(:,1));
title("Xonar U5 Left (16-bits 50 Ohm Term)");
ylabel("Amplitude");
xlabel("Time Seconds");
grid();

subplot(2,1,2);
plot(X,A(:,2));
title("Xonar U5 Rigth (16-bits 50 Ohm Term)");
ylabel("Amplitude");
xlabel("Time Seconds");
grid()
