Path: news.mathworks.com!not-for-mail
From: "Ashwini Deshpande" <vd.ashwini@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: wavread and wavplay
Date: Thu, 4 Dec 2008 07:50:22 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 17
Message-ID: <gh823u$fev$1@fred.mathworks.com>
Reply-To: "Ashwini Deshpande" <vd.ashwini@mathworks.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1228377022 15839 172.30.248.38 (4 Dec 2008 07:50:22 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 4 Dec 2008 07:50:22 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1101624
Xref: news.mathworks.com comp.soft-sys.matlab:504895


Hi,

I have 2 sound files in .wav format. I need to run those two files.
When i am playing first sound file, if i want to stop it and want to play the second, what do i do??

Just have look at the following:
[y, Fs] = wavread('F:\sound_1.wav');
[y1, Fs1] = wavread('F:\sound_2.wav');
wavplay(y,Fs,'async') ;
wavplay(y1,Fs1,'async')  ;

Here, 1st sound file which is running has to be stopped as soon i execute the 4th line code.

Any help would be greatly appreciated ..

Ashwini