-
-
Notifications
You must be signed in to change notification settings - Fork 1
FileDecoder
A stream.Readable class that converts a flac encoded file to PCM output.
You can pass all the options that can expect the Readable object, but also you can pass:
-
file: String
- The file with the FLAC stream and where it will be read
- You must provide this value
-
oggStream: Boolean
- Determines if the Input data is an OGG Stream
- Defaults to false
-
metadata: Array or Boolean
- If is an array, tells the decoder to emit
metadata
when metadata blocks of the types passed are found - If is
true
, tells the decoder to emitmetadata
on all metadata blocks found - Defaults to
STREAMINFO
only
- If is an array, tells the decoder to emit
-
outputAs32: Boolean
- Tells the decoder that the output is in
bitsPerSamples
but must store it in 32 bit integer. Default value isfalse
except if thebitsPerSamples
is 24. - Optional
- Tells the decoder that the output is in
Reads a chunk of decoded audio, in interleaved PCM format, on which every sample has the bit depth from FileDecoder.getBitsPerSample()
. As example, a 16bit stream with 2 channels will produce the following structure in the buffer:
--------------------------------------------------
| Left | Right | Left | Right | Left | Right | ... | 2 bytes per sample
| Frame 0 | Frame 1 | Frame 2 | ... | 4 bytes per frame
--------------------------------------------------
Here, frame means a pack of one sample for every channel. Differs from FLAC frame that is other thing.
Gets the number of samples stored in the stream, or 0 if it's undefined.
Gets the number of channels stored in the stream.
Returns the channel assignment of the stream. Values are from bindings.format.ChannelAssignment.
Gets the bits per sample of the stream.
When some metadata has been read, is emitted in a event and it passes an JS representation of it.