18.1.2 Port Objects

Port objects, as returned by openport(), have the following methods:

audio portcloseport()
Close the port.

audio portgetfd()
Return the file descriptor as an int.

audio portgetfilled()
Return the number of filled samples.

audio portgetfillable()
Return the number of fillable samples.

audio portreadsamps(nsamples)
Read a number of samples from the queue, blocking if necessary. Return the data as a string containing the raw data, (e.g., 2 bytes per sample in big-endian byte order (high byte, low byte) if you have set the sample width to 2 bytes).

audio portwritesamps(samples)
Write samples into the queue, blocking if necessary. The samples are encoded as described for the readsamps() return value.

audio portgetfillpoint()
Return the `fill point'.

audio portsetfillpoint(fillpoint)
Set the `fill point'.

audio portgetconfig()
Return a configuration object containing the current configuration of the port.

audio portsetconfig(config)
Set the configuration from the argument, a configuration object.

audio portgetstatus(list)
Get status information on last error.