WriteanAudioFileExample.m 458 Bytes
%% Write an Audio File  
% Create a WAVE file from the example file |handel.mat|, and read the file
% back into MATLAB(R).   

%% 
% Write a WAVE (|.wav|) file in the current folder. 
load ('handel.mat')
filename = 'test.wav';
audiowrite(filename,data/3000,Fs);
clear data Fs  

%% 
% Read the data back into MATLAB using |audioread|. 
[cc,Fs] = audioread(filename);  

%% 
% Listen to the audio. 
sound(cc,Fs);   



%% 
% Copyright 2012 The MathWorks, Inc.