MATLAB Answers

I Made

Combining wavplay and filepath not working ?

Asked by I Made
on 29 Mar 2013

Can't we dynamically choose the file we wanted to play? i tried this :

    [FileName,PathName] = uigetfile('*.wav','Select Audio File ');
    wavplay(FileName,45040);

and i've tried :

    [FileName,PathName] = uigetfile('*.wav','Select Audio File ');
    FILE=fullfile(PathName, FileName);
    wavplay(FILE,45040);

I got this following error: Input arguments must be real uint8, int16, single, or double-precision.

  3 Comments

I Made
on 29 Mar 2013

Then I tried :

    [FileName,PathName] = uigetfile('*.wav','Select Audio File ');
    FILE=fullfile(PathName, FileName);
    A=load(FILE);
    wavplay(A,fs);

got this following error : Unknown text on line number 1 of ASCII file E:\Blabla\test\host2.wav "RIFF0ˆ".

Walter Roberson
on 29 Mar 2013

Is anything else able to play the file? 'RIFF' is very common in WAV files but it needs to be followed by binary 0 not by '0'

I Made
on 30 Mar 2013

I think the header of all .wav file is RIFF, what do you mean by anything else able to play the file?

Products

No products are associated with this question.

0 Answers

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply today