-
-
Notifications
You must be signed in to change notification settings - Fork 1
StreamEncoder
Melchor Garau Madrigal edited this page Oct 25, 2017
·
3 revisions
A stream.Transform class that converts some PCM input to flac output, all in memory, suitable for connecting to other streams.
You can pass all the options that can expect the Transform object, but also you can pass:
-
isOggStream: Boolean
- Indicates if the output would be an ogg stream or a raw FLAC stream
- Defaults to false
-
channels: Number
- Indicates to the encoder the number of channels that will have the PCM stream
- Defaults to 2
-
bitsPerSample: Number
- Indicates to the encoder the bits per sample of the PCM stream
- Defaults to 16
-
samplerate: Number
- Indicates to the encoder the samplerate of the PCM stream
- Defaults to 44100
-
oggSerialNumber: Number
- Indicates the serial number of the ogg stream, if its an ogg stream
- No default value, you must provide this value if its an ogg stream
-
totalSamplesEstimate: Number
- An estimation of the total samples of the PCM stream
- Optional
-
inputAs32: Boolean
- Tells the encoder that the input is in
bitsPerSamples
but stored in 32 bit integer, common in 24 bit audio input. Default value isfalse
except if thebitsPerSamples
is 24. - Optional -
compressionLevel: Number
- Sets the compression level for the decoder, changing the parameters below this one for you
- See what are the parameters changed
- Optional
-
doMidSideStereo: Boolean
- When
true
, encodes stereo streams using mid-side encoding. - Optional
- When
-
looseMidSideStereo: Number
- When
true
anddoMidSideStereo
set totrue
, enables adaptative switching between mid-side and left-right encoding - Optional
- When
-
apodization: String
- See this link
- Optional
-
maxLpcOrder: Number
- Set the maximum LPC Order, or set to 0 to use fixed predictors
- Optional
-
qlpCoeffPrecision: Number
- Set the precision of the QLP coefficients, or 0 to let the encoder select it for you
- Optional
-
doQlpCoeffPrecSearch: Boolean
- See this link
- Optional
-
doExhaustiveModelSearch: Boolean
- See this link
- Optional
-
minResidualPartitionOrder: Number
- See this link
- Optional
-
maxResidualPartitionOrder: Number
- See this link
- Optional
-
riceParameterSearchDist: Number
- See this link
- Optional
Writes some PCM data to be encoded. The buffer must contain PCM with the bps passed in the constructor, that is, if you want a 16 bps, the buffer must contain 16bps PCM. It will transform for you to 32bit buffer, that is the kind of data accepted by FLAC library, except you set to true the option inputAs32
.
Reads all encoded audio stored in the buffer. It is not recommended to pass the size parameter, available in the implementation of Transform stream.