How to save audio in .mat file

조회 수: 5 (최근 30일)
DSB
DSB 2017년 4월 20일
댓글: Shreyan Basu Ray 2021년 10월 5일
Hi I'm a beginner in matlab and i want to save audio in .mat file how can i do that?

답변 (1개)

KSSV
KSSV 2017년 4월 20일
y = rand(10000,1) ; % some random signal
Fs = 1100 ; % som frequency
save demo.mat ; % save the data into .mat file
clear y Fs % remove the variables
load demo.mat ;
filename = 'handel.wav';
audiowrite(filename,y,Fs);
[y,Fs] = audioread('handel.wav');
sound(y,Fs);
% clear sound
  댓글 수: 5
Soulaimene Jaoua
Soulaimene Jaoua 2021년 2월 15일
how can I save it as MP3 file
Shreyan Basu Ray
Shreyan Basu Ray 2021년 10월 5일
@Soulaimene Jaoua change the extension from .wav to .mp3 by simply renaming the extension and then create the .mat file

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by