pub struct FileStreamerNode { /* private fields */ }
Expand description
Streams a file, which must be specified to the constructor and cannot be changed thereafter. This node is a stopgap solution, and should be considered temporary. It will likely remain for backward compatibility. Libaudioverse plans to eventually offer a more generic streaming node that also supports web addresses; such a node will have a completely different, less buffer-like interface. In order to stream a file, it must be passed through a resampler. Consequentlty, the position property is slightly inaccurate and the ended property and callback are slightly delayed.
This node has no inputs.
Outputs:
index | channels | description |
---|---|---|
0 | Depends on the file. | The output of the stream. |
Implementations§
Source§impl FileStreamerNode
impl FileStreamerNode
Sourcepub fn new(server: &Server, path: &CString) -> Result<FileStreamerNode>
pub fn new(server: &Server, path: &CString) -> Result<FileStreamerNode>
Creates a new file streamer node.
Sourcepub fn ended(&self) -> BoolProperty
pub fn ended(&self) -> BoolProperty
Returns the ended property. This property is read-only. Switches from false to true once the stream has ended completely and gone silent. This property will never go true unless looping is false.
Sourcepub fn looping(&self) -> BoolProperty
pub fn looping(&self) -> BoolProperty
Default value: False
If true, this node repeats the file from the beginning once it reaches the end. Note that setting looping means that ended will never go true. If ended is already true, it may take until the end of the next processing block for ended to properly go false once more.
Sourcepub fn position(&self) -> DoubleProperty
pub fn position(&self) -> DoubleProperty
Range: dynamic
Default value: 0.0
The position of playback, in seconds. The range of this property corresponds to the total duration of the file. Note that this property may be slightly inaccurate because this node has to pass data through a resampler.