Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: wavread and wavplay
Date: Thu, 4 Dec 2008 10:19:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 20
Message-ID: <gh8aqm$684$1@fred.mathworks.com>
References: <gh823u$fev$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1228385942 6404 172.30.248.35 (4 Dec 2008 10:19:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 4 Dec 2008 10:19:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1338633
Xref: news.mathworks.com comp.soft-sys.matlab:504915


"Ashwini Deshpande" <vd.ashwini@mathworks.com> wrote in message <gh823u$fev$1@fred.mathworks.com>...
> 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 


try slipping in a 'clear playsnd' statement before you want to play the second sound.