upload wav file

Hi
In order to upload a wav file, I think I should be using the wavread command. I tried using that, but it results in an error. I tried using,
y = wavread('C:\Users\Admin\Desktop\audacity\Audacity 1.3 Beta (Unicode)\prompts')
The error says, "invalid wav file".
I need to upload two files which I have recorded and find out the delay between them.I have figured out how to find delay by considering sample waves, but not how to upload the files and then calculate the time delay. Could someone please help with uploading the files and then tell me how to use them normally like any waves generated in the matlab?
Thanks in advance

댓글 수: 7

Honglei Chen
Honglei Chen 2011년 10월 28일
I'm not sure what you mean by 'upload'. Do you mean you want to read them? Also, it seems to me that 'prompts' is a directory, not really a filename. Do you have a prompts.wav?
Padma
Padma 2011년 10월 28일
I have a file in .wav form. Yes, i want to read them and use them to compute time delay.
Walter Roberson
Walter Roberson 2011년 10월 28일
Is "prompts" a directory or is it a file in .wav format that somehow was created without any extension? Or did you mean
y = wavread('C:\Users\Admin\Desktop\audacity\Audacity 1.3 Beta (Unicode)\prompts.wav')
Padma
Padma 2011년 10월 28일
it is a recorded sound file in .wav format. i realise now the path is wrong. My question is that i have two wav files and i want to read them to matlab.
Honglei Chen
Honglei Chen 2011년 10월 28일
If you have two files, just use wavread with each one of them, you will get two signals in the workspace. Just make sure you do not use the same variable name for both of them.
Sandhu
Sandhu 2011년 10월 28일
is both signals are with same length ????
Sandhu
Sandhu 2011년 10월 28일
if so, this will help you.
http://www.mathworks.de/matlabcentral/newsreader/view_thread/256986

댓글을 달려면 로그인하십시오.

답변 (1개)

Sandhu
Sandhu 2011년 10월 28일

1 개 추천

i hope this may help u.
[FileName,PathName] = uigetfile('*.wav');
PathOriginal=sprintf('%s%s',PathName,FileName);
[xt,fs]=wavread(PathOriginal);
from here manage ur code. here xt is lenth of signal and 'fs' is sampling rate of wav format. and it is common for all wav formats : its value is 44.1k

댓글 수: 4

Padma
Padma 2011년 10월 28일
I am new to matlab, just started using it since yesterday. could you please explain the first two lines in more detail.
Honglei Chen
Honglei Chen 2011년 10월 28일
Just give it a try in MATLAB, it opens a gui and you can select a file. Then you have the path to your file in PathOriginal variable.
Padma
Padma 2011년 10월 28일
in the second statement,what is it exactly doing, is it concatenating the existing path with my .wav file? please correct me if i am wrong.
Jan
Jan 2011년 10월 28일
Matlab's documentation is a high quality source of explanations:
Type this in the command window:
help uigetfile
doc uigetfile
(and the same for "sprintf" and "wavread")

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Audio I/O and Waveform Generation에 대해 자세히 알아보기

태그

질문:

2011년 10월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by