sox, ctrl-c

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

sox, ctrl-c

René Bastian
Hi,

the man page recommends to use Ctrl-C for interrupting a sound played
by sox.

When I use Ctrl-C the terminal is shot down?
 
Is there a better way?

--
René Bastian
www.pythoneon.org

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: sox, ctrl-c

Jan Stary
On May 08 10:16:14, René Bastian wrote:
> Hi,
>
> the man page recommends to use Ctrl-C for interrupting a sound played
> by sox.
>
> When I use Ctrl-C the terminal is shot down?

Is that a question?

How exactly do you play your sound file?

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: sox, ctrl-c

René Bastian
Le Tue, 8 May 2012 19:29:01 +0200,
Jan Stary <[hidden email]> a écrit :

> On May 08 10:16:14, René Bastian wrote:
> > Hi,
> >
> > the man page recommends to use Ctrl-C for interrupting a sound
> > played by sox.
> >
> > When I use Ctrl-C the terminal is shot down?
>
> Is that a question?
>
> How exactly do you play your sound file?

I think that sox is not involved,
but the use of the shell. I apologize.

>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond.
> Discussions will include endpoint security, mobile security and the
> latest in malware threats.
> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________ Sox-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/sox-users
>



--
René Bastian
www.pythoneon.org

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: sox, ctrl-c

Fmiser
In reply to this post by René Bastian
> René Bastian wrote:

> Hi,
>
> the man page recommends to use Ctrl-C for interrupting a sound
> played by sox.
>
> When I use Ctrl-C the terminal is shot down?
>  
> Is there a better way?

What terminal are you using?  
What shell are you using?  
Does this happen with commands other than "play"?

I suppose you could use Ctrl-Z to pause the process, then run
"kill %" to kill it.  At least, that works in my Debian Linux running bash in mrxvt.

--   Philip

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: sox, ctrl-c

René Bastian
Le Tue, 8 May 2012 19:37:35 -0500,
Fmiser <[hidden email]> a écrit :

> > René Bastian wrote:
>
> > Hi,
> >
> > the man page recommends to use Ctrl-C for interrupting a sound
> > played by sox.
> >
> > When I use Ctrl-C the terminal is shot down?
> >  
> > Is there a better way?
>
> What terminal are you using?  

I use Debian 6.0 and Gnome 2.30.2

> What shell are you using?  

I think 'bash'

> Does this happen with commands other than "play"?

No

>
> I suppose you could use Ctrl-Z to pause the process, then run
> "kill %" to kill it.  At least, that works in my Debian Linux running
> bash in mrxvt.

I will try Ctrl-Z - may be it's a good idea.


>
> --   Philip
>

--
René Bastian
www.pythoneon.org

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: sox, ctrl-c

Jan Stary
On May 10 05:44:31, René Bastian wrote:

> Le Tue, 8 May 2012 19:37:35 -0500,
> Fmiser <[hidden email]> a écrit :
>
> > > René Bastian wrote:
> >
> > > Hi,
> > >
> > > the man page recommends to use Ctrl-C for interrupting a sound
> > > played by sox.
> > >
> > > When I use Ctrl-C the terminal is shot down?

How exactly do you pay your files?

> > What shell are you using?  
>
> I think 'bash'

What does "echo $SHELL" say?


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: sox, ctrl-c

René Bastian
Le Thu, 10 May 2012 07:45:29 +0200,
Jan Stary <[hidden email]> a écrit :

> On May 10 05:44:31, René Bastian wrote:
> > Le Tue, 8 May 2012 19:37:35 -0500,
> > Fmiser <[hidden email]> a écrit :
> >
> > > > René Bastian wrote:
> > >
> > > > Hi,
> > > >
> > > > the man page recommends to use Ctrl-C for interrupting a sound
> > > > played by sox.
> > > >
> > > > When I use Ctrl-C the terminal is shot down?
>
> How exactly do you pay your files?

My music is written in Python. But this has nothing to do with
'sox' or 'play'. The problem with Ctrl-C appears when using
'sox' in python scripts.

>
> > > What shell are you using?  
> >
> > I think 'bash'
>
> What does "echo $SHELL" say?

/bin/bash

>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond.
> Discussions will include endpoint security, mobile security and the
> latest in malware threats.
> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________ Sox-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/sox-users
>



--
René Bastian
www.pythoneon.org

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: sox, ctrl-c

Jan Stary
On May 10 10:13:21, René Bastian wrote:

> Le Thu, 10 May 2012 07:45:29 +0200,
> Jan Stary <[hidden email]> a écrit :
>
> > On May 10 05:44:31, René Bastian wrote:
> > > Le Tue, 8 May 2012 19:37:35 -0500,
> > > Fmiser <[hidden email]> a écrit :
> > >
> > > > > René Bastian wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > the man page recommends to use Ctrl-C for interrupting a sound
> > > > > played by sox.
> > > > >
> > > > > When I use Ctrl-C the terminal is shot down?
> >
> > How exactly do you pay your files?
>
> My music is written in Python. But this has nothing to do with
> 'sox' or 'play'.

OK. Why ask here then?

> The problem with Ctrl-C appears when using 'sox' in python scripts.

But it has nothing to do with sox or play, right?

I give up.



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: sox, ctrl-c

Fmiser
In reply to this post by René Bastian
> > > René Bastian wrote:
> > >
> > > the man page recommends to use Ctrl-C for interrupting
> > > a sound played by sox.
> > >
> > > When I use Ctrl-C the terminal is shot down?

> > Jan Stary <[hidden email]> a écrit :
> >
> > How exactly do you play your files?

> René Bastian wrote:
>
> My music is written in Python. But this has nothing to do with
> 'sox' or 'play'. The problem with Ctrl-C appears when using
> 'sox' in python scripts.

So you are using Ctrl-C to try to stop SoX when SoX was
started from within a Python script?

This is an example of not explaining the whole situation.

Ctrl-C is a way to stop _any_ program run from a bash shell.
This works for SoX as well.  But it works only if it was run
from an interactive shell.

That is, you have an xterm (gnometerminal, kterm, mrxvt,
aterm, etc) open and at the command prompt (usually "$") you
type "play file.wav".  This will cause SoX to play the file
and while the file is playing the the command prompt will be
gone and the xterm won't accept most commands until SoX is
done playing the file.  If you want to stop sooner than the
end of the file, typing Ctrl-C will stop SoX and give you a
command prompt again.  This is called "interactive".

Based on your original question, I presumed this is how
you were using SoX because it is the standard way.

Now in this post you surprise me by saying "...when using sox
in python scripts."  This would NOT be interactive.

When Jan asked "How exactly do you play your files?" it was
to find out how you are _starting_ SoX so we can advise you on
how to _stop_ SoX.

What terminal is "shot down" with Ctrl-C?  Python?  An xterm?
Or something else?

How are you using Ctrl-C?  In the script?  Typed into a
terminal?  What terminal?   When I asked earlier, you answered
"I use Debian 6.0 and Gnome 2.30.2" - which is NOT a terminal.

What do you mean by "shot down"?  The python script stops?
The terminal window closes? The terminal freezes?

There are lots of clever and helpful people on this list - but
you are just wasting our time if you ask a question but don't
give us enough information to understand what you are doing.

So again, quoting the very first response to your very first
post, "How exactly do you play your sound file?"

Tell us that and maybe we can help.

--   Philip

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: sox, ctrl-c

René Bastian
Le Thu, 10 May 2012 12:34:17 -0500,
Fmiser <[hidden email]> a écrit :

> > > > René Bastian wrote:
> > > >
> > > > the man page recommends to use Ctrl-C for interrupting
> > > > a sound played by sox.
> > > >
> > > > When I use Ctrl-C the terminal is shot down?
>
> > > Jan Stary <[hidden email]> a écrit :
> > >
> > > How exactly do you play your files?
>
> > René Bastian wrote:
> >
> > My music is written in Python. But this has nothing to do with
> > 'sox' or 'play'. The problem with Ctrl-C appears when using
> > 'sox' in python scripts.
>
> So you are using Ctrl-C to try to stop SoX when SoX was
> started from within a Python script?
>
> This is an example of not explaining the whole situation.
>
> Ctrl-C is a way to stop _any_ program run from a bash shell.
> This works for SoX as well.  But it works only if it was run
> from an interactive shell.
>
> That is, you have an xterm (gnometerminal, kterm, mrxvt,
> aterm, etc) open and at the command prompt (usually "$") you
> type "play file.wav".  This will cause SoX to play the file
> and while the file is playing the the command prompt will be
> gone and the xterm won't accept most commands until SoX is
> done playing the file.  If you want to stop sooner than the
> end of the file, typing Ctrl-C will stop SoX and give you a
> command prompt again.  This is called "interactive".
>
> Based on your original question, I presumed this is how
> you were using SoX because it is the standard way.
>
> Now in this post you surprise me by saying "...when using sox
> in python scripts."  This would NOT be interactive.
>
> When Jan asked "How exactly do you play your files?" it was
> to find out how you are _starting_ SoX so we can advise you on
> how to _stop_ SoX.
>
> What terminal is "shot down" with Ctrl-C?  Python?  An xterm?
> Or something else?
>
> How are you using Ctrl-C?  In the script?  Typed into a
> terminal?  What terminal?   When I asked earlier, you answered
> "I use Debian 6.0 and Gnome 2.30.2" - which is NOT a terminal.
>
> What do you mean by "shot down"?  The python script stops?
yes
> The terminal window closes?
no

> The terminal freezes?

What do you mean by "freeze"?

It is not possible to use mouse or keyboard in the terminal.

>
> There are lots of clever and helpful people on this list - but
> you are just wasting our time if you ask a question but don't
> give us enough information to understand what you are doing.
>
> So again, quoting the very first response to your very first
> post, "How exactly do you play your sound file?"

sox works when it is used in a standalone mode. OK.

But it's not a good idea to use it in a script, because the Ctrl-C
signal to interrupt the sound seems not be catched properly.

>
> Tell us that and maybe we can help.
>
> --   Philip

I am confused that I waste your time. On the other hand:
since 2005 I use a home brew Python script (actually with 'ossaudiodev'
or the older equivalent module) which intercepts the Contrl-C interrupts
without damaging his terminal. So I can not imagine that professional
software does not work in the same manner.

Thanks for your help.
--
René Bastian
www.pythoneon.org

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: sox, ctrl-c

Jan Stary
> Le Thu, 10 May 2012 12:34:17 -0500,
> Fmiser <[hidden email]> a écrit :
>
> > > > > René Bastian wrote:
> > > > >
> > > > > the man page recommends to use Ctrl-C for interrupting
> > > > > a sound played by sox.
> > > > >
> > > > > When I use Ctrl-C the terminal is shot down?
> >
> > > > Jan Stary <[hidden email]> a écrit :
> > > >
> > > > How exactly do you play your files?
> >
> > > René Bastian wrote:
> > >
> > > My music is written in Python. But this has nothing to do with
> > > 'sox' or 'play'. The problem with Ctrl-C appears when using
> > > 'sox' in python scripts.
> >
> > So you are using Ctrl-C to try to stop SoX when SoX was
> > started from within a Python script?
> >
> > This is an example of not explaining the whole situation.
> >
> > Ctrl-C is a way to stop _any_ program run from a bash shell.
> > This works for SoX as well.  But it works only if it was run
> > from an interactive shell.
> >
> > That is, you have an xterm (gnometerminal, kterm, mrxvt,
> > aterm, etc) open and at the command prompt (usually "$") you
> > type "play file.wav".  This will cause SoX to play the file
> > and while the file is playing the the command prompt will be
> > gone and the xterm won't accept most commands until SoX is
> > done playing the file.  If you want to stop sooner than the
> > end of the file, typing Ctrl-C will stop SoX and give you a
> > command prompt again.  This is called "interactive".
> >
> > Based on your original question, I presumed this is how
> > you were using SoX because it is the standard way.
> >
> > Now in this post you surprise me by saying "...when using sox
> > in python scripts."  This would NOT be interactive.
> >
> > When Jan asked "How exactly do you play your files?" it was
> > to find out how you are _starting_ SoX so we can advise you on
> > how to _stop_ SoX.
> >
> > What terminal is "shot down" with Ctrl-C?  Python?  An xterm?
> > Or something else?
> >
> > How are you using Ctrl-C?  In the script?  Typed into a
> > terminal?  What terminal?   When I asked earlier, you answered
> > "I use Debian 6.0 and Gnome 2.30.2" - which is NOT a terminal.
> >
> > What do you mean by "shot down"?  The python script stops?
> yes
> > The terminal window closes?
> no
>
> > The terminal freezes?
>
> What do you mean by "freeze"?
>
> It is not possible to use mouse or keyboard in the terminal.
>
> >
> > There are lots of clever and helpful people on this list - but
> > you are just wasting our time if you ask a question but don't
> > give us enough information to understand what you are doing.
> >
> > So again, quoting the very first response to your very first
> > post, "How exactly do you play your sound file?"
>
> sox works when it is used in a standalone mode. OK.

No. Wrong answer. The question was:

        "How exactly do you play your sound file?"

In the time you have spent writing these mails telling nothing,
you could have quoted the damn line a million times already.

> But it's not a good idea to use it in a script, because the Ctrl-C
> signal to interrupt the sound seems not be catched properly.

If you run a python script from a shell (we still don't know
if that is the case), then doing ctrl-c sends an interrupt
to that scriot. How the script (which we know nothing about)
deals with that is up to that python script.

Show us your python script, or at least how it calls sox,
and show us how exactly you run it. Wihtout that, we cannot
help you.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: sox, ctrl-c

Fmiser
In reply to this post by René Bastian
> > Fmiser wrote:
> >
> > So again, quoting the very first response to your very first
> > post, "How exactly do you play your sound file?"
>
> sox works when it is used in a standalone mode. OK.
>
> But it's not a good idea to use it in a script, because the
> Ctrl-C signal to interrupt the sound seems not be catched
> properly.

I use SoX in a lot of scripts.  It, like most command line
tools, works very will in scripts

Are you really expecting SoX to correctly handle a Ctrl-C
given to some other script?  The catching of Ctrl-C is the job
of the _script_ - NOT SoX.

> I am confused that I waste your time.

You seem to be asking for help with a problem.  We have asked
for information _from_ you so we understand what you are doing
so we can help you.  You are not answering all our questions.
This makes it very hard to give you good help.

> On the other hand: since 2005 I use a home brew Python
> script (actually with 'ossaudiodev' or the older equivalent
> module) which intercepts the Contrl-C interrupts without
> damaging his terminal. So I can not imagine that
> professional software does not work in the same manner.

Once again, it seems you are expecting SoX to respond to a
Ctrl-C command given to a different program.

Are you expect SoX to correctly handle a Ctrl-C you give to
your python script?  The _script_ has to do that!

It's a chain.  If you start a python script then anything else
you type (like ctrl-c) goes to the _python_ script - not
whatever other stuff the script might have started.  If the
python script is expected to control/manange/change/quit
something it started, then that control has to be deliberatly
built into the python script.

>From what you have said so far, since you haven't told us how
you are playing your files, I'm _guessing_ you have a script
that has no provision for halting a running SoX instance.
Complaining to SoX people about the problems with your python
script not going to solve many problems.

And - we _still_ don't have an answer to "How exactly are you
playing your files?"

And so any answer you get may still not work because we are
_guessing_ at how you are using SoX.

I'm sorry René.  I would like to help - but I _cannot_ read you
mind, or even read your terminal.  My understanding of the
situation is only what you tell us.  And right now I don't know
enough to provide any help at all.

--     Philip

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: sox, ctrl-c

René Bastian
Le Fri, 11 May 2012 23:49:09 -0500,
Fmiser <[hidden email]> a écrit :

> > > Fmiser wrote:
> > >
> > > So again, quoting the very first response to your very first
> > > post, "How exactly do you play your sound file?"
> >
> > sox works when it is used in a standalone mode. OK.
> >
> > But it's not a good idea to use it in a script, because the
> > Ctrl-C signal to interrupt the sound seems not be catched
> > properly.
>
> I use SoX in a lot of scripts.  It, like most command line
> tools, works very will in scripts


Hi, (I am back :)

Here my script:
-------------------------------
def jouer(nomfaudio):
    if nomfaudio[-4:] == ".wav":
        comm = " ".join(["play", nomfaudio])
    elif nomfaudio[-4:] == ".raw":
        comm = " ".join(["play -c2 -s -b16 -r44100", nomfaudio])
    print comm
   
    try:
        subprocess.call(comm, shell=True)
    except exceptions.KeyboardInterrupt:
        return

def dulocal(rep="~/"):
    comm = "du -h " + rep
    try:
        subprocess.call(comm, shell=True)
    except exceptions.KeyboardInterrupt:
        return
----------------------------------
 For comparison, I join the function "dulocal" which can
be interupted by Ctrl-C without damaging anything.
 My old pure python script, using the obsolete OSS, works
also (since 2005).

 If I interrupt the 'jouer' function by Ctrl-C, mouse and
keyboard no longer work (Nota: 'mplayer' has the same
behaviour than 'play' [and seems to resample from 44100 to
48000 Hz ! This is, in my sense, a very bad way]).

Excuse me, I am not clever in writing English (I would
prefer french or german :)

Best regards,

>
> Are you really expecting SoX to correctly handle a Ctrl-C
> given to some other script?  The catching of Ctrl-C is the job
> of the _script_ - NOT SoX.
>
> > I am confused that I waste your time.
>
> You seem to be asking for help with a problem.  We have asked
> for information _from_ you so we understand what you are doing
> so we can help you.  You are not answering all our questions.
> This makes it very hard to give you good help.
>
> > On the other hand: since 2005 I use a home brew Python
> > script (actually with 'ossaudiodev' or the older equivalent
> > module) which intercepts the Contrl-C interrupts without
> > damaging his terminal. So I can not imagine that
> > professional software does not work in the same manner.
>
> Once again, it seems you are expecting SoX to respond to a
> Ctrl-C command given to a different program.
>
> Are you expect SoX to correctly handle a Ctrl-C you give to
> your python script?  The _script_ has to do that!
>
> It's a chain.  If you start a python script then anything else
> you type (like ctrl-c) goes to the _python_ script - not
> whatever other stuff the script might have started.  If the
> python script is expected to control/manange/change/quit
> something it started, then that control has to be deliberatly
> built into the python script.
>
> >From what you have said so far, since you haven't told us how
> you are playing your files, I'm _guessing_ you have a script
> that has no provision for halting a running SoX instance.
> Complaining to SoX people about the problems with your python
> script not going to solve many problems.
>
> And - we _still_ don't have an answer to "How exactly are you
> playing your files?"
>
> And so any answer you get may still not work because we are
> _guessing_ at how you are using SoX.
>
> I'm sorry René.  I would like to help - but I _cannot_ read you
> mind, or even read your terminal.  My understanding of the
> situation is only what you tell us.  And right now I don't know
> enough to provide any help at all.
>
> --     Philip
>



--
René Bastian
www.pythoneon.org

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: sox, ctrl-c

Jan Stary
> def jouer(nomfaudio):
>     if nomfaudio[-4:] == ".wav":
>         comm = " ".join(["play", nomfaudio])
>     elif nomfaudio[-4:] == ".raw":
>         comm = " ".join(["play -c2 -s -b16 -r44100", nomfaudio])
>     print comm
>    
>     try:
>         subprocess.call(comm, shell=True)
>     except exceptions.KeyboardInterrupt:
>         return
>
> def dulocal(rep="~/"):
>     comm = "du -h " + rep
>     try:
>         subprocess.call(comm, shell=True)
>     except exceptions.KeyboardInterrupt:
>         return

This seems like a python wrapper for shell commands.
If I understand your code above, you call this script,
from a shell, which in turn spawns a subshell, in which
play is launched.  Why on earth do you do that?

>  If I interrupt the 'jouer' function by Ctrl-C, mouse and
> keyboard no longer work

We still don't know how _exactly_ you play your files.
You have defined a function. OK. Now, in what terminal,
using which shell, do you run what, exactly?
(For the slow: quote the exact command, and the exact response.)


Presumably, you have sent a SIGNIT to a running python script.
I doubt this has anything to do with sox at all. I suggest you
take this to the python list and annoy the hell of someone else.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: sox, ctrl-c

René Bastian
Le Sat, 12 May 2012 18:37:38 +0200,
Jan Stary <[hidden email]> a écrit :

> def jouer(nomfaudio):
>     if nomfaudio[-4:] == ".wav":
>         comm = " ".join(["play", nomfaudio])
>     elif nomfaudio[-4:] == ".raw":
>         comm = " ".join(["play -c2 -s -b16 -r44100", nomfaudio])
>     print comm
>    
>     try:
>         #subprocess.call(comm, shell=True)
          os.system(comm)
>     except exceptions.KeyboardInterrupt:
>         return

sox works correctly if I replace 'subshell.call ...'
by 'os.system ...' which is obsolete in the newest python modules.
'os.system' catches the KeyboardInterrupt.

>

[...]
> I doubt this has anything to do with sox at all.
[...]

I wrote:
---------------------------------------------------
Le Tue, 8 May 2012 19:36:03 +0200,
René Bastian <[hidden email]> a écrit :

> Le Tue, 8 May 2012 19:29:01 +0200,
> Jan Stary <[hidden email]> a écrit :
>
> > On May 08 10:16:14, René Bastian wrote:
> > > Hi,
> > >
> > > the man page recommends to use Ctrl-C for interrupting a sound
> > > played by sox.
> > >
> > > When I use Ctrl-C the terminal is shot down?
> >
> > Is that a question?
> >
> > How exactly do you play your sound file?
No matter.
>
> I think that sox is not involved, <======================== True
> but the use of the shell. I apologize. <=================== False
--------------------------------------

Jan, why do you insist?


--
René Bastian
www.pythoneon.org

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: sox, ctrl-c

Jan Stary
On May 12 21:30:25, René Bastian wrote:

> Le Sat, 12 May 2012 18:37:38 +0200,
> Jan Stary <[hidden email]> a écrit :
>
> > def jouer(nomfaudio):
> >     if nomfaudio[-4:] == ".wav":
> >         comm = " ".join(["play", nomfaudio])
> >     elif nomfaudio[-4:] == ".raw":
> >         comm = " ".join(["play -c2 -s -b16 -r44100", nomfaudio])
> >     print comm
> >    
> >     try:
> >         #subprocess.call(comm, shell=True)
>  os.system(comm)
> >     except exceptions.KeyboardInterrupt:
> >         return
>
> sox works correctly if I replace 'subshell.call ...'
> by 'os.system ...' which is obsolete in the newest python modules.
> 'os.system' catches the KeyboardInterrupt.

Your problem is a python problem.
Please take it to the python list.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users