Thread Subject: wavread and wavplay

Subject: wavread and wavplay

From: Ashwini Deshpande

Date: 4 Dec, 2008 07:50:22

Message: 1 of 5

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

Subject: wavread and wavplay

From: Denis

Date: 4 Dec, 2008 10:14:02

Message: 2 of 5

"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.

Subject: wavread and wavplay

From: Dave Brackett

Date: 4 Dec, 2008 10:19:02

Message: 3 of 5

"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.

Subject: wavread and wavplay

From: Denis

Date: 4 Dec, 2008 10:20:16

Message: 4 of 5

see this thread for a possible solution:

http://www.mathworks.com/matlabcentral/newsreader/view_thread/240412

greetings
Denis

Subject: wavread and wavplay

From: Ashwini Deshpande

Date: 4 Dec, 2008 10:47:01

Message: 5 of 5

"Denis " <dzone@gmx.de> wrote in message <gh8at0$77s$1@fred.mathworks.com>...
> see this thread for a possible solution:
>
> http://www.mathworks.com/matlabcentral/newsreader/view_thread/240412
>
> greetings
> Denis


Thank u very much ....

Its working fine !!!!!!

Ashwini

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
urgent Ashwini Deshpande 4 Dec, 2008 02:55:09
wavread Ashwini Deshpande 4 Dec, 2008 02:55:09
wavplay Ashwini Deshpande 4 Dec, 2008 02:55:09
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com