How to save audio in .mat file

18 ビュー (過去 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 Center および File ExchangeAudio and Video Data についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by