Borrar filtros
Borrar filtros

How to save audio in .mat file

16 visualizaciones (últimos 30 días)
DSB
DSB el 20 de Abr. de 2017
Comentada: Shreyan Basu Ray el 5 de Oct. de 2021
Hi I'm a beginner in matlab and i want to save audio in .mat file how can i do that?

Respuestas (1)

KSSV
KSSV el 20 de Abr. de 2017
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 comentarios
Soulaimene Jaoua
Soulaimene Jaoua el 15 de Feb. de 2021
how can I save it as MP3 file
Shreyan Basu Ray
Shreyan Basu Ray el 5 de Oct. de 2021
@Soulaimene Jaoua change the extension from .wav to .mp3 by simply renaming the extension and then create the .mat file

Iniciar sesión para comentar.

Categorías

Más información sobre Audio I/O and Waveform Generation en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by