From: Sermed on
Dear all

I'm working on a GUI where I play a sound signal using "soundsc"...
I want to design a button in the GUI that stops the soundsc
anybody knows how that can be done/ or is there any function that stops the sound playing.

thanks in advance and Merry Chrismas
Sermed
From: Leslie McBrayer on
> I'm working on a GUI where I play a sound signal using "soundsc"... I want
> to design a button in the GUI that stops the soundsc
> anybody knows how that can be done/ or is there any function that stops
> the sound playing.

You could play the signal with audioplayer and use the stop (or pause)
method. For more information, type "doc audioplayer" at the command prompt.


From: Sermed on
Thanks a lot Leslie ... I've just tried it and it seems that it is work perfectly,,

Merry Chrismas


"Leslie McBrayer" <lmcbrayer(a)mathworks.com> wrote in message <hgtq8p$bt4$1(a)fred.mathworks.com>...
> > I'm working on a GUI where I play a sound signal using "soundsc"... I want
> > to design a button in the GUI that stops the soundsc
> > anybody knows how that can be done/ or is there any function that stops
> > the sound playing.
>
> You could play the signal with audioplayer and use the stop (or pause)
> method. For more information, type "doc audioplayer" at the command prompt.
>
From: Sermed on
Hey agian

I got another problem while implementing the audioplayer in GUI.

As you know the GUI is a multipul of functions and it seems that the audioplayer is terminated when the function is ended.

That means that the 60 seconds wav.file is terminated after 1 second....

Any suggestions

Best
Sermed



"Sermed " <sermadrid(a)hotmail.com> wrote in message <hgvn3q$1a5$1(a)fred.mathworks.com>...
> Thanks a lot Leslie ... I've just tried it and it seems that it is work perfectly,,
>
> Merry Chrismas
>
>
> "Leslie McBrayer" <lmcbrayer(a)mathworks.com> wrote in message <hgtq8p$bt4$1(a)fred.mathworks.com>...
> > > I'm working on a GUI where I play a sound signal using "soundsc"... I want
> > > to design a button in the GUI that stops the soundsc
> > > anybody knows how that can be done/ or is there any function that stops
> > > the sound playing.
> >
> > You could play the signal with audioplayer and use the stop (or pause)
> > method. For more information, type "doc audioplayer" at the command prompt.
> >
From: Leslie McBrayer on
> As you know the GUI is a multipul of functions and it seems that the
> audioplayer is terminated when the function is ended.
> That means that the 60 seconds wav.file is terminated after 1 second....

I don't have GUI-specific experience, but it is true that audioplayer
objects only persist within the function that creates them. One way to work
around this is to modify the function to include an output argument, such
as:

function outputObj = myPlayFunction(myInputs)
outputObj = audioplayer(...);

When you call the function, you'll create a variable in the current
workspace that you can then pause or stop.


 |  Next  |  Last
Pages: 1 2
Prev: Invalid handle errors
Next: polar plot for half plane