Expected a string for the parameter name, instead the input type was 'double'. what to ?

% Setting variables
fs = 1000; % Sampling rate in Hz
bits = 8; % Bits per sample
channels = 1; % Number of channels: 1=mono
recObj = audiorecorder(fs, bits, channels);
% Collect a sample of your speech with a microphone and plot the signal data:
% Record voice for 2 seconds
%recObj = audiorecorder;
disp('Start speaking.')
recordblocking(recObj, 2);
disp('End of Recording.');
% Play back the recording
play(recObj);
% Store data in double-precision array
y = getaudiodata(recObj);
filename='sample01.wav';
% Plot the waveform
%figure;
%plot(myRecording)
%xlabel('time (milliseconds)')
%ylabel('amplitude')
% Converting audiorecorder object to wav
audiowrite(filename,y, fs,bits);

1 Kommentar

@Anil Kumar: please show us the complete error message. This means all of the red text.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange

Produkte

Tags

Gefragt:

am 13 Nov. 2018

Kommentiert:

am 13 Nov. 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by