Sound module question
pehr anderson
pehr at pehr.net
Wed Jul 12 01:51:31 EDT 2000
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