WarbleStream class

A WarbleStream encapsulates a loaded audio file.

Streams can be buffered or unbuffered. An unbuffered stream is streamed from disk, reducing memory usage and startup delay. It cannot be played in overlapping fashion: each play must finish before the next play starts.

A buffered stream is loaded into memory, and can be played in overlapping fashion using playBuffered.

Multiple streams may be created for a given audio source.

Constructors

WarbleStream(String id, {String name = ""})
WarbleStream.fromInfo(StreamInfo info)

Properties

buffered bool
If true, this is a buffered stream, and can be played in overlapping fashion.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
id String
A unique ID for this stream.
final
length int
The length of the stream in samples.
getter/setter pair
name String
A readable name for the stream. It may not be unique: multiple streams created from the same file will have the same name.
getter/setter pair
percentage double
The percentage progress this stream has made through its total length.
no setter
position int
The position of the stream in samples.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sampleRate int
The sample rate of the stream in samples per second.
getter/setter pair

Methods

close() Future<bool>
Closes this stream, releasing resources.
gain(double gain) Future<bool>
Sets the gain for this stream.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pan(double pan) Future<bool>
Sets the pan for this stream.
pause(bool pause) Future<bool>
Pauses this stream, silencing its output.
play() Future<bool>
Plays this stream starting from the current seek point.
playBuffered(int from, int to) Future<bool>
Plays a copy of this stream created from the underlying buffer.
seek(int position) Future<bool>
Seeks this stream, moving to position (given in samples).
toString() String
A string representation of this object.
inherited
update() Future<bool>
Update fetches the latest position for this stream.

Operators

operator ==(Object other) bool
The equality operator.
inherited