Python audio output switch

Discussion in 'Python' started by Pan Xingzhi, Jul 25, 2006.

  1. Pan Xingzhi

    Pan Xingzhi Guest

    Guys:

    Hi there. Recently I'll have to write a quite interesting program
    in Python on a Linux box. What I need is a function which allows the
    user to 'switch' the audio output from <an audio
    file>/<microphone>/<line in>.

    I'm not quite familiar with Linux programming. I've checked some
    python media frameworks but still need some light. Does anybody have
    experience on this? Thanks in advance!

    Regards,
    Pan Xingzhi
     
    Pan Xingzhi, Jul 25, 2006
    #1
    1. Advertising

  2. Pan Xingzhi

    Ben Sizer Guest

    Pan Xingzhi wrote:
    > Guys:
    >
    > Hi there. Recently I'll have to write a quite interesting program
    > in Python on a Linux box. What I need is a function which allows the
    > user to 'switch' the audio output from <an audio
    > file>/<microphone>/<line in>.


    They are audio inputs, not audio outputs!

    I don't know of any Python modules for this, though maybe one exists.
    Most documentation is for C coders, and depends a lot upon what sound
    system your distribution of Linux is running. If you are using OSS
    (Open Sound System), you may be able to access /dev/mixer to choose
    which device is the default input. (Although I am more used to systems
    where you can read each input independently.) If so, you may find this
    page gives you a few pointers:
    http://www.oreilly.de/catalog/multilinux/excerpt/ch14-07.htm

    If you are using something else, like ALSA, you may want to look at
    their documentation. Or perhaps http://jackaudio.org/ will be of use.

    --
    Ben Sizer
     
    Ben Sizer, Jul 26, 2006
    #2
    1. Advertising

  3. Pan Xingzhi

    Pan Xingzhi Guest

    Sorry maybe I didn't describe what I need clearly. Yes they're inputs.
    Actually I need a switch to 'hook' them to line out so when I switch, a
    mp3 file is played, or an external CD player is played, or what I'm
    talking is played.

    Thanks anyway. I'm checking ALSA, though maybe I'll have to write sth in
    C :)

    Ben Sizer wrote:
    > Pan Xingzhi wrote:
    >> Guys:
    >>
    >> Hi there. Recently I'll have to write a quite interesting program
    >> in Python on a Linux box. What I need is a function which allows the
    >> user to 'switch' the audio output from <an audio
    >> file>/<microphone>/<line in>.

    >
    > They are audio inputs, not audio outputs!
    >
    > I don't know of any Python modules for this, though maybe one exists.
    > Most documentation is for C coders, and depends a lot upon what sound
    > system your distribution of Linux is running. If you are using OSS
    > (Open Sound System), you may be able to access /dev/mixer to choose
    > which device is the default input. (Although I am more used to systems
    > where you can read each input independently.) If so, you may find this
    > page gives you a few pointers:
    > http://www.oreilly.de/catalog/multilinux/excerpt/ch14-07.htm
    >
    > If you are using something else, like ALSA, you may want to look at
    > their documentation. Or perhaps http://jackaudio.org/ will be of use.
    >
     
    Pan Xingzhi, Jul 26, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. aeonsun
    Replies:
    2
    Views:
    441
    Luc The Perverse
    Mar 11, 2007
  2. Florian von Savigny
    Replies:
    4
    Views:
    120
  3. Alx

    output data to audio

    Alx, May 22, 2004, in forum: Perl Misc
    Replies:
    6
    Views:
    127
    Alythh
    May 24, 2004
  4. sick dick
    Replies:
    0
    Views:
    398
    sick dick
    Apr 3, 2006
  5. Switch Within A Switch

    , Apr 22, 2006, in forum: Javascript
    Replies:
    7
    Views:
    119
    Lasse Reichstein Nielsen
    Apr 22, 2006
Loading...

Share This Page