compress audio signal recorded in GUI
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Muhammad Talha Bashir
am 18 Jun. 2021
Beantwortet: Walter Roberson
am 18 Jun. 2021
function pushbutton_Callback(hObject, eventdata, handles)
r=audiorecorder;
recordblocking(r,5);
play(r);
mr=getaudiodata(r);
axes(handles.axes1);
plot(mr);
In this code I want to apply compression on the recorded signal 'mr'.
Akzeptierte Antwort
Walter Roberson
am 18 Jun. 2021
%one way of compressing
compressed_mr1 = mr(1:2:end,:);
%another way of compressing
compressed_mr2 = resample(mr(:,1), 8000, 22050);
%another way of compressing
tn = tempname;
fid = fopen(tn, 'w');
fwrite(fid, mr(:,1), 'double');
fclose(fid);
zip([tn '.zip'], tn);
fid = fopen([tn .zip'], 'r');
compressed_mr3 = fread(fid, [1 inf], '*uint8');
fclose(fid)
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Signal Processing Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!