You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i am testing the 333D04 and the code is not working, what could be the problem?
Befourf finding your code i was testing my code for simple data acquisition (no scaling) the sensor seems to connect as an external device. The problem is when i beng on the sensor there is no clues of the impact in the waveform data or in the recording.
Can somone halp me with that? i post you the code:
clear all
close all
clc
% Parametri di configurazione
sampleRate = 44100; % Frequenza di campionamento in Hz
samplesPerFrame = 44100; % Numero di campioni per frame
numChannels = 1; % Numero di canali (mono)
recordingTime = 10; % Durata della registrazione in secondi
% List all available audio devices
devices = getAudioDevices(audioDeviceReader);
disp('Available audio devices:');
disp(devices);
% Specifica il nome del dispositivo esterno (Update based on the listed devices)
externalDeviceName ='Microfono (333D04 10780870666313184230223)';
% Error handling for device setup
try
% Crea un oggetto audioDeviceReader per acquisire dati dalla scheda audio esterna
deviceReader = audioDeviceReader('SampleRate', sampleRate, ...
'SamplesPerFrame', samplesPerFrame, ...
'NumChannels', numChannels, ...
'Device', externalDeviceName);
catch ME
disp('Error creating audioDeviceReader:');
disp(ME.message);
return;
end
% Verifica la configurazione della scheda audio
deviceInfo = info(deviceReader);
disp(deviceInfo);
% Calcola il numero di frame necessari per la durata della registrazione
numFrames = round(recordingTime * sampleRate / samplesPerFrame);
% Prealloca l'array per memorizzare i dati acquisiti
audioData = zeros(numFrames * samplesPerFrame, numChannels);
disp('Inizio registrazione...')
% Acquisisci i dati audio in frame
for i = 1:numFrames
audioFrame = deviceReader();
audioData((i-1)samplesPerFrame+1:isamplesPerFrame, :) = audioFrame;
end
disp('Registrazione completata.')
% Rilascia la risorsa del dispositivo
release(deviceReader);
% Verifica la lunghezza dei dati acquisiti
disp(['Lunghezza dei dati acquisiti: ', num2str(length(audioData))]);
% Salva i dati acquisiti in un file audio (opzionale)
audiowrite('PROVA.wav', audioData, sampleRate);
% Riproduci i dati acquisiti (opzionale)
sound(audioData, sampleRate);
thank you in advance!
The text was updated successfully, but these errors were encountered:
Good morning,
i am testing the 333D04 and the code is not working, what could be the problem?
Befourf finding your code i was testing my code for simple data acquisition (no scaling) the sensor seems to connect as an external device. The problem is when i beng on the sensor there is no clues of the impact in the waveform data or in the recording.
Can somone halp me with that? i post you the code:
clear all
close all
clc
% Parametri di configurazione
sampleRate = 44100; % Frequenza di campionamento in Hz
samplesPerFrame = 44100; % Numero di campioni per frame
numChannels = 1; % Numero di canali (mono)
recordingTime = 10; % Durata della registrazione in secondi
% List all available audio devices
devices = getAudioDevices(audioDeviceReader);
disp('Available audio devices:');
disp(devices);
% Specifica il nome del dispositivo esterno (Update based on the listed devices)
externalDeviceName ='Microfono (333D04 10780870666313184230223)';
% Error handling for device setup
try
% Crea un oggetto audioDeviceReader per acquisire dati dalla scheda audio esterna
deviceReader = audioDeviceReader('SampleRate', sampleRate, ...
'SamplesPerFrame', samplesPerFrame, ...
'NumChannels', numChannels, ...
'Device', externalDeviceName);
catch ME
disp('Error creating audioDeviceReader:');
disp(ME.message);
return;
end
% Verifica la configurazione della scheda audio
deviceInfo = info(deviceReader);
disp(deviceInfo);
% Calcola il numero di frame necessari per la durata della registrazione
numFrames = round(recordingTime * sampleRate / samplesPerFrame);
% Prealloca l'array per memorizzare i dati acquisiti
audioData = zeros(numFrames * samplesPerFrame, numChannels);
disp('Inizio registrazione...')
% Acquisisci i dati audio in frame
for i = 1:numFrames
audioFrame = deviceReader();
audioData((i-1)samplesPerFrame+1:isamplesPerFrame, :) = audioFrame;
end
disp('Registrazione completata.')
% Rilascia la risorsa del dispositivo
release(deviceReader);
% Verifica la lunghezza dei dati acquisiti
disp(['Lunghezza dei dati acquisiti: ', num2str(length(audioData))]);
% Salva i dati acquisiti in un file audio (opzionale)
audiowrite('PROVA.wav', audioData, sampleRate);
% Riproduci i dati acquisiti (opzionale)
sound(audioData, sampleRate);
thank you in advance!
The text was updated successfully, but these errors were encountered: