Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
wavread multiple sound signals

Subject: wavread multiple sound signals

From: KAMAL ABAZA

Date: 25 Jan, 2012 21:10:11

Message: 1 of 3

Hello Guys ,

I want to input sound files to the Matlab so I use 'wavread' of course ,
but I need to input a lot of files , so Is there a way to instead of reading a single file at a time to wavread a whole folder for example.


Thank you.

Subject: wavread multiple sound signals

From: sherine

Date: 26 Jan, 2012 08:28:44

Message: 2 of 3

On Jan 25, 11:10 pm, "KAMAL ABAZA" <abaza_ka...@yahoo.com> wrote:
> Hello Guys ,
>
> I want to input sound files to the Matlab so I use 'wavread' of course ,
> but I need to input a lot of files , so Is there a way to instead of reading a single file at a time to wavread a whole folder for example.
>
> Thank you.

salamo 3alikom
I think you can unify the name of the files (except the serial number)
and use this for loop:
for i=1:size(name,1)
temp = [name(i,:) '.wav'];
tempwav = wavread(temp);
data{i} = tempwav;

I hope it could help

Sherine

Subject: wavread multiple sound signals

From: Lothar Schmidt

Date: 26 Jan, 2012 09:32:26

Message: 3 of 3

Am 26.01.2012 09:28, schrieb sherine:
> On Jan 25, 11:10 pm, "KAMAL ABAZA"<abaza_ka...@yahoo.com> wrote:
>> Hello Guys ,
>>
>> I want to input sound files to the Matlab so I use 'wavread' of course ,
>> but I need to input a lot of files , so Is there a way to instead of reading a single file at a time to wavread a whole folder for example.
>>
>> Thank you.
>
> salamo 3alikom
> I think you can unify the name of the files (except the serial number)
> and use this for loop:
> for i=1:size(name,1)
> temp = [name(i,:) '.wav'];
> tempwav = wavread(temp);
> data{i} = tempwav;
>
> I hope it could help
>
> Sherine

or

filelist=dir('*.wav');
for i=1:numel(filelist)
[data,Fs]=wavread(filelist(i).name);
result(i)=your_action(data,Fs);
end

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us