How does one make a wav file?

31 views (last 30 days)
Leticia Garcia
Leticia Garcia on 23 Mar 2012
I am using the wavwrite command on MatLab and I am having a lot of problems. I have in my workspace "X" and "Y" data points in a (1 X 59 array) on both. They are points I need to make a specific signal. I am unsure about how to set up the command.
wavwrite(y,filename)
For y being used in my case I have 2 workspace data how would that work?
What does the filename have to be shared to?
Or maybe I'm going about this the wrong way to make a Wav file...
  1 Comment
Jan
Jan on 23 Mar 2012
A [1 x 59] vector means a very short sound. What are the values of X and Y? Is it a stereo sound or does X represent the time?

Sign in to comment.

Answers (1)

Wayne King
Wayne King on 23 Mar 2012
Here is an example
Fs = 2e4;
t = 0:1/2e4:1-(1/2e4);
x = 1/2*cos(2*pi*5000*t);
% write the signal x to a .wav file
wavwrite(x,Fs,16,'test.wav');

Tags

Community Treasure Hunt

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

Start Hunting!