# Streaming Overview

The Streaming module of the File library consists of a set of functions that are built on top of the primitive layer of the library. These functions are used a lot by the audio library and may be used directly by a video player in your game.

Any file may be streamed - you just have to write a parser for your data format, or you can choose to use the default parser, which makes a chunk every 2K in the file.

When the streamer is running, it asynchronously reads blocks of data from the file as quickly as possible and stores them in a circular buffer. Clients of the streamer obtain a pointer to the next chunk by calling the `rw::core::filesys::Stream::GetChunk` function. When the chunk is no longer needed, it is released using `rw::core::filesys::Stream::ReleaseChunk`. This frees the space in the circular buffer and allows the streamer to continue reading from the file. The streamer will continue reading until it reaches either the end of file or a user-defined end chunk.

You can queue up multiple requests for the streamer, which will service them in the order specified. For each request queued, a unique request ID is returned and can be used to check the status of the request or to cancel it. It is also possible to kill an entire stream, which returns it to the state it was in after being initialized.

Programs can create multiple streams which can run simultaneously, either from the same device or from different devices. The streamer provides a mechanism for coordinating access to a device by multiple streams as well as by other file I/O functions.

The streamer also provides a mechanism for separating chunks into multiple classes based on their chunk type and for delivering chunks from each class to separate output points called taps.

## See Also

- Create
- Filters
- Start
- Pointer
- Release
- Destroy
- Coordinate
- Alignment
- Performance