WriteanAudioFileExample.m
454 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,cc/3000,Fs);
clear cc 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.