Sound module question

shuz at bresnanlink.net.bbs shuz at bresnanlink.net.bbs
Wed Jul 12 03:00:01 EDT 2000


I have already tried that. I need to record sound in a time sensitive
eviroment. I will most likely need to write my own sound module which I really

don't want to do...because I don't know where to start with that either. I
have this really simple program called sound-recorder that has simple read and

write but in order to stop a recording the person needs to do ^c (ctrl + c)
how would I start that program in a thread and be able to stop it at a certain

point using ctrl + c? A sound module for python would probably be the best
solution still.

I guess that is a better description of my problem... Thanks for the idea
though,
Aaron



pehr anderson wrote:

> I've started mucking around with sound and have
> seen the os.system command work well for most of my needs.
>
> import os
> os.system("esdplay file.wav")
>
> Redhat and Gnome like to use the Enlightenment sound daemon.
> NOTE: It isn't always started by default.
> To start the daemon just run "esd" as the user (you don't need to be
> root).
> The RPM included with Redhat-6.2 is esound-0.2.17-2.i386.rpm
>
> I've upgraded my system with Helix gnome so my esound rpm is
> esound-0.2.18-1_helix_1
>
> Esound includes the the "esdctl" command to cache wav files
> for quick playback or looping. If you run these through os.system
> that should be fast enough for most of your needs. I'm sure there
> are better ways to talk to the esound daemon, but this was *very* easy.
>
> Here is the help for esdctl:
>
> [pehr at morseall pehr]$ esdctl
> esdctl error (1):  command line - not enough arguments
> esdctl [options] [command]
>
> options:
> -s, --server=host:port        contact esd server on host at port
>
> commands:
> lock                          foreign clients may not use the server
> unlock                        foreign clients may use the server
> standby, off                  suspend sound output for other programs
> resume, on                    resume sound output
> cache sample                  cache a sample in the server
> getid name                    retrieve a sample id from its name
> free name                     uncache a sample in the server
> play name                     play a cached sample once
> loop name                     make a cached sample loop
> stop name                     stop the looping sample at end
> serverinfo                    get server info from server
> allinfo                       get player and sample info from server
> panstream <id> <left> <right> set panning for a stream
> pansample <id> <left> <right> set default panning for a sample
>                               - left/right pan values scaled to 256.
> standbymode                   see if server's on standby, etc.
>
> Aaron Berg wrote:
> >
> > I started programming python a few months ago and I am still learning.
> > Does anyone know of a sound module for simple reading and writing of
> > sound in linux? I know there is a win32 sound module and there is one
> > for SGI but is there one for linux? oss or alsa... I don't know much
> > about this issue so it is possible i am just looking in the wrong place.
> > Thanks,
> > Aaron



More information about the Python-list mailing list