1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| name = [];
out = daqhwinfo('winsound');
a=analoginput('winsound',0); % initialisation pour le vecteur ensuite
for i = 1:length(out.BoardNames(:))
a(i)=analoginput('winsound',i-1); % on creer tout ce qui est possible comme carte son pour connaitre les noms!
end
h=daqhwinfo(a); % on récolte toutes les informations concernant les différentes carte son
if isempty(h)
...
end
if ~iscell(h)
...
end
% on peut mettre jusqu'à 31 caractères
for i = 1:length(h)
if(length(h{i}.DeviceName) == 31)
name = [name ; h{i}.DeviceName];
else
taille = length(h{i}.DeviceName);
nom = h{i}.DeviceName;
for j = taille+1:31
nom(j) = ' ';
end
name = [name ; nom];
end
end |