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:14:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 23
Message-ID: <gh8aha$2lq$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 1228385642 2746 172.30.248.35 (4 Dec 2008 10:14:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 4 Dec 2008 10:14:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 533792
Xref: news.mathworks.com comp.soft-sys.matlab:504911


"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 


The problem is that you put a whole block of data into y and y1.
Lets say it is a 2min Track then it need 2min till it will finished. To solve this problem, you have to write an m-file wich puts only small blocks into y and y1 and everytime time the data is done, refill/put again the y or y1.

Hope that helps a bit.