August'24: Kamaelia is in maintenance mode and will recieve periodic updates, about twice a year, primarily targeted around Python 3 and ecosystem compatibility. PRs are always welcome. Latest Release: 1.14.32 (2024/3/24)
An instance of this class is a read file adaptor component. It's constructor arguments are all optional. If no arguments are provided, then the default is to read from stdin, one line at a time, as fast as possible. Note that this will cause the outbox to fill at the same rate as stdin can provide data. (Be wary of memory constraints this will cause!)
filename="filename" - the name of the file to read. If you want stdin, do not provide a filename! If you want the output from a command, also leave this blank...
command="command" - the name of the command you want the output from. Leave the filename blank if you use this!
"bitrate" - read at a specified bitrate. "line" - read on a line by line basis "block" - read the file on a block by block basis.
If bitrate mode is set, you should set bitrate= to your desired bitrate (unless you want 64Kbit/s), and chunkrate= to your desired chunkrate (unless you want 24 fps). You are expected to be able to handle the bit rate you request!
If block mode is set then you should set readsize (size of the block in bytes), and steptime (how often you want bytes). If steptime is set to zero, you will read blocks at the speed the source device can provide them. (be wary of memory constraints)
After setting the ReadFileAdaptor in motion, you can then hook it into your linkages like any other component.
Warning!
Standard constructor, see class docs for details
Opens the appropriate file handle
Got a problem with the documentation? Something unclear, could be clearer? Want to help with improving? Constructive criticism, preferably in the form of suggested rewording is very welcome.
Please leave the feedback here, in reply to the documentation thread in the Kamaelia blog.