esd_wrap.c

[ Python Module : esd ]

Contents

ESD_BUF_SIZE = (4*1024)

[ Constant: int ]
length of the audio buffer size

ESD_KEY_LEN = (16)

[ Constant: int ]
length of the authorization key, octets

ESD_DEFAULT_PORT = (5001)

[ Constant: int ]
default port for the EsounD server

ESD_DEFAULT_RATE = (44100)

[ Constant: int ]
default sample rate for the EsounD server

ESD_NAME_MAX = (128)

[ Constant: int ]
maximum length of a stream/sample name

ESD_VOLUME_BASE = (256)

[ Constant: int ]

ESD_PROTO_CONNECT = ESD_PROTO_CONNECT

[ Constant: int ]
hold the zero value

ESD_PROTO_LOCK = ESD_PROTO_LOCK

[ Constant: int ]
pseudo "security" functionality

ESD_PROTO_UNLOCK = ESD_PROTO_UNLOCK

[ Constant: int ]
disable "foreign" client connections

ESD_PROTO_STREAM_PLAY = ESD_PROTO_STREAM_PLAY

[ Constant: int ]
stream functionality: play, record, monitor

ESD_PROTO_STREAM_REC = ESD_PROTO_STREAM_REC

[ Constant: int ]
play all following data as a stream

ESD_PROTO_STREAM_MON = ESD_PROTO_STREAM_MON

[ Constant: int ]
record data from card as a stream

ESD_PROTO_SAMPLE_CACHE = ESD_PROTO_SAMPLE_CACHE

[ Constant: int ]
sample functionality: cache, free, play, loop, EOL, kill

ESD_PROTO_SAMPLE_FREE = ESD_PROTO_SAMPLE_FREE

[ Constant: int ]
cache a sample in the server

ESD_PROTO_SAMPLE_PLAY = ESD_PROTO_SAMPLE_PLAY

[ Constant: int ]
release a sample in the server

ESD_PROTO_SAMPLE_LOOP = ESD_PROTO_SAMPLE_LOOP

[ Constant: int ]
play a cached sample

ESD_PROTO_SAMPLE_STOP = ESD_PROTO_SAMPLE_STOP

[ Constant: int ]
loop a cached sample, til eoloop

ESD_PROTO_SAMPLE_KILL = ESD_PROTO_SAMPLE_KILL

[ Constant: int ]
stop a looping sample when done

ESD_PROTO_STANDBY = ESD_PROTO_STANDBY

[ Constant: int ]
free and reclaim /dev/dsp functionality

ESD_PROTO_RESUME = ESD_PROTO_RESUME

[ Constant: int ]
release /dev/dsp and ignore all data

ESD_PROTO_SAMPLE_GETID = ESD_PROTO_SAMPLE_GETID

[ Constant: int ]
move these to a more logical place when we're ready to break the protocol

ESD_PROTO_STREAM_FILT = ESD_PROTO_STREAM_FILT

[ Constant: int ]
get the ID for an already-cached sample

ESD_PROTO_SERVER_INFO = ESD_PROTO_SERVER_INFO

[ Constant: int ]
esd remote management

ESD_PROTO_ALL_INFO = ESD_PROTO_ALL_INFO

[ Constant: int ]
get server information (ver, sample rate, format)

ESD_PROTO_SUBSCRIBE = ESD_PROTO_SUBSCRIBE

[ Constant: int ]
get all information (server info, players, samples)

ESD_PROTO_UNSUBSCRIBE = ESD_PROTO_UNSUBSCRIBE

[ Constant: int ]
track new and removed players and samples

ESD_PROTO_STREAM_PAN = ESD_PROTO_STREAM_PAN

[ Constant: int ]
esd remote control

ESD_PROTO_SAMPLE_PAN = ESD_PROTO_SAMPLE_PAN

[ Constant: int ]
set stream panning

ESD_PROTO_MAX = ESD_PROTO_MAX

[ Constant: int ]
for bounds checking

ESD_MASK_BITS = (0x000F)

[ Constant: int ]
bits of stream/sample data

ESD_BITS8 = (0x0000)

[ Constant: int ]

ESD_BITS16 = (0x0001)

[ Constant: int ]

ESD_MASK_CHAN = (0x00F0)

[ Constant: int ]
how many interleaved channels of data

ESD_MONO = (0x0010)

[ Constant: int ]

ESD_STEREO = (0x0020)

[ Constant: int ]

ESD_MASK_MODE = (0x0F00)

[ Constant: int ]
whether it's a stream or a sample

ESD_STREAM = (0x0000)

[ Constant: int ]

ESD_SAMPLE = (0x0100)

[ Constant: int ]

ESD_ADPCM = (0x0200)

[ Constant: int ]
TODO: anyone up for this? =P

ESD_MASK_FUNC = (0xF000)

[ Constant: int ]
the function of the stream/sample, and common functions

ESD_PLAY = (0x1000)

[ Constant: int ]

ESD_MONITOR = (0x0000)

[ Constant: int ]
functions for streams only

ESD_RECORD = (0x2000)

[ Constant: int ]

ESD_STOP = (0x0000)

[ Constant: int ]
functions for samples only

ESD_LOOP = (0x2000)

[ Constant: int ]

esd_open_sound(host)

[ returns int ]
opens channel, authenticates connection, and prefares for protos returns EsounD socket for communication, result < 0 = error server = listen socket (localhost:5001, 192.168.168.0:9999 rate, format = (bits | channels | stream | func)

esd_lock(esd)

[ returns int ]
Disables a foreign client from connecting.

esd_unlock(esd)

[ returns int ]
Re-enables foreign clients from connecting after an esd_lock() has precluded connection.

esd_standby(esd)

[ returns int ]
Frees the audio device so that other programs can use it.

esd_resume(esd)

[ returns int ]
Reclaims the audio device for the esd server after having freed it with esd_standby().

esd_play_stream(format,rate,host,name)

[ returns int ]
open a socket for playing, monitoring, or recording as a stream the *_fallback functions try to open /dev/dsp if there's no EsounD

esd_play_stream_fallback(format,rate,host,name)

[ returns int ]

esd_monitor_stream(format,rate,host,name)

[ returns int ]
Creates a monitor which (I think) allows you to read everything that is played out of the server.

esd_record_stream(format,rate,host,name)

[ returns int ]
Opens up a stream for recording.

esd_record_stream_fallback(format,rate,host,name)

[ returns int ]
Opens up /dev/dsp for recording.

esd_filter_stream(format,rate,host,name)

[ returns int ]
Don't know what this does.

esd_sample_cache(esd,format,rate,length,name)

[ returns int ]
cache a sample in the server returns sample id, < 0 = error This is expected to be followed by /length/ bytes of sample data written directly to the socket.

esd_confirm_sample_cache(esd)

[ returns int ]
Should be called immediately after caching a sample with esd_sample_cache to confirm that the sample has been cached and to obtain the id of the newly cached sample.

esd_sample_getid(esd,name)

[ returns int ]
get the sample id for an already-cached sample

esd_sample_free(esd,sample)

[ returns int ]
uncache a sample in the server

esd_sample_play(esd,sample)

[ returns int ]
play a cached sample once

esd_sample_loop(esd,sample)

[ returns int ]
make a cached sample loop

esd_sample_stop(esd,sample)

[ returns int ]
stop the looping sample at end

esd_close(esd)

[ returns int ]
closes fd, previously obtained by esd_open

1. class esd_server_info_t

[ created from struct esd_server_info_t ]
structures to retrieve information about streams/samples from the server

self.version

[ Member data: returns int ]
server version encoded as an int

self.format

[ Member data: returns esd_format_t ]
magic int with the format info

self.rate

[ Member data: returns int ]
sample rate

del this

[ Destructor: returns void ]

2. class esd_player_info_t

[ created from struct esd_player_info_t ]

self.source_id

[ Member data: returns int ]
either a stream fd or sample id

self.rate

[ Member data: returns int ]
sample rate

self.left_vol_scale

[ Member data: returns int ]
volume scaling

self.right_vol_scale

[ Member data: returns int ]
volume scaling

self.format

[ Member data: returns esd_format_t ]
magic int with the format info

del this

[ Destructor: returns void ]

getName()

[ Member : returns char * ]
returns the player name

3. class esd_player_info_list_t

[ created from struct esd_player_info_list_t ]
List of player info structures.

del this

[ Destructor: returns void ]

__len__()

[ Member : returns int ]

__getitem__(index)

[ Member : returns esd_player_info_t * ]

4. class esd_sample_info_t

[ created from struct esd_sample_info_t ]

self.sample_id

[ Member data: returns int ]
either a stream fd or sample id

self.rate

[ Member data: returns int ]
sample rate

self.left_vol_scale

[ Member data: returns int ]
volume scaling

self.right_vol_scale

[ Member data: returns int ]
volume scaling

self.format

[ Member data: returns esd_format_t ]
magic int with the format info

self.length

[ Member data: returns int ]
total buffer length

del this

[ Destructor: returns void ]

getServer()

[ Member : returns esd_server_info_t * ]
Returns the server information.

getName()

[ Member : returns char * ]
Returns the sample name.

5. class esd_sample_info_list_t

[ created from struct esd_sample_info_list_t ]

del this

[ Destructor: returns void ]

__len__()

[ Member : returns int ]

__getitem__(index)

[ Member : returns esd_sample_info_t * ]

6. class esd_info_t

[ created from struct esd_info_t ]
Contains all of the information about the server and its associated players and samples. We've stripped this down so that SWIG doesn't produce accessor methods that could lead to seg-faults.

del this

[ Destructor: returns void ]

getServer()

[ Member : returns esd_server_info_t * ]
Returns the server information.

getPlayers()

[ Member : returns esd_player_info_list_t * ]

getSamples()

[ Member : returns esd_sample_info_list_t * ]

esd_print_server_info(server_info)

[ returns void ]
print server into to stdout

esd_print_player_info(player_info)

[ returns void ]

esd_print_sample_info(sample_info)

[ returns void ]

esd_print_all_info(all_info)

[ returns void ]
print all info to stdout

esd_get_server_info(esd)

[ returns esd_server_info_t * ]
retrieve server properties (sample rate, format, version number)

esd_free_server_info(server_info)

[ returns void ]
release all memory allocated for the server properties structure

esd_get_all_info(esd)

[ returns esd_info_t * ]
retrieve all information from server esd_info_t *esd_get_all_info( int esd );

esd_subscribe_all_info(esd)

[ returns esd_info_t * ]
retrieve all information from server, and update until unsubsribed or closed

esd_unsubscribe_info(esd)

[ returns esd_info_t * ]
esd_info_t *esd_update_info( int esd, esd_info_t *info, esd_update_info_callbacks_t *callbacks );

esd_free_all_info(info)

[ returns void ]
release all memory allocated for the esd info structure

esd_set_stream_pan(esd,stream_id,left_scale,right_scale)

[ returns int ]
reset the volume panning for a stream

esd_set_default_sample_pan(esd,sample_id,left_scale,right_scale)

[ returns int ]
reset the default volume panning for a sample

esd_play_file(name_prefix,filename,fallback)

[ returns int ]
***************************************************************** esdfile.c - audiofile wrappers for sane handling of files

esd_file_cache(esd,name_prefix,filename)

[ returns int ]

cvar.esd_audio_format

[ Global : esd_format_t esd_audio_format ]
***************************************************************** audio.c - abstract the sound hardware for cross platform usage

cvar.esd_audio_rate

[ Global : int esd_audio_rate ]

esd_audio_open()

[ returns int ]

esd_audio_close()

[ returns void ]

esd_audio_pause()

[ returns void ]

esd_audio_write(buffer,buf_size)

[ returns int ]

esd_audio_read(buffer,buf_size)

[ returns int ]

esd_audio_flush()

[ returns void ]