Audio-MPEG
view release on metacpan or search on metacpan
Marks output stream as original. Default is 1.
=item I<CRC>
If set to 1, CRCs are computed and inserted into the stream. Default is 0.
Note: many players have difficulty handling CRCs. It's not recommended
to set this flag to true (besides, it's of pretty limited value).
=item I<padding_type>
Frame padding. 0 is no padding, 1 is pad all frames, 2 is adjust padding
(default).
=item I<strict>
Enforce strict ISO compliance. Default is 0.
=item I<vbr>
Select variable bitrate output, and set type of VBR. Values are "vbr",
"old", "new", and "mtrh" (vbr and old are equivalent). Default is to not
encode VBR, but to used a constant bitrate.
=item I<vbr_quality>
Set the quality of VBR encoding. Values range from 0 (best) to 9 (worst).
LAME chooses default.
=item I<average_bitrate>
If set to a bitrate, VBR encoding is used so that the average bitrate
of the output MP3 stream equals this value.
=item I<min_bit_rate>
If set to a bitrate, the bitrate of the stream will not fall below this value
(unless the input stream is audio silence, then the stream may fall lower).
=item I<min_hard_bit_rate>
If set to a bitrate, the bitrate of the stream will never fall below this
value, even if the input stream is audio silence.
=item I<max_bit_rate>
If set to a bitrate, the bitrate of the stream will never exceed this rate.
=item I<lowpass_filter_frequency>
If set to a frequency (in Hertz), the input will pass through a filter
before being encoded. Values range from 1 to 50_000. Default is for LAME to
choose.
=item I<no_lowpass_filter>
If this exists, filtering is disabled.
=item I<lowpass_filter_width>
The width of the filter expressed as a percentage of the filter frequency.
Defaults to 15%.
=item I<highpass_filter_frequency>
If set to a frequency (in Hertz), the input will pass through a filter
before being encoded. Values range from 1 to 50_000. Default is for LAME to
choose. If set to -1, filtering is disabled.
=item I<no_highpass_filter>
If this exists, filtering is disabled.
=item I<highpass_filter_width>
The width of the filter expressed as a percentage of the filter frequency.
Defaults to 15%.
=item I<apply_delay>
This will correct for the MP3 encoding delay. If set to 1, the first
B<encoder_delay>() samples of the first frame's PCM stream will be
skipped and not encoded. Default is to not correct for delay.
=back
=item B<encoder_delay>()
This method will return the number of PCM samples that will be skipped on
the input due to the delay the encoder implicitly creates. By skipping these
samples, the output stream will have the same audio runtime as the input stream.
=item B<encode_float>(I<$pcm>)
This method will take the input PCM stream $I<pcm> and return zero or more
complete MP3 frames. The input is a series of multiplexed, B<native>
4-byte floats. If there are two input channels, it will alternate between
left and right channels (starting with left). If it is a single channel,
it will be the left channel only.
Values of the samples may range from -1.0 to +1.0.
The output is a scalar that contains zero or more MP3 frames.
=item B<encode16>(I<$pcm>)
This method will take the input PCM stream $I<pcm> and return zero or more
complete MP3 frames. The input is a series of multiplexed, B<native>
signed 2-byte integers. If there are two input channels, it will alternate
between left and right channels (starting with left). If it is a single
channel, it will be the left channel only.
Values of the samples may range from -32768 to +32767.
The output is a scalar that contains zero or more MP3 frames.
=item B<encode_flush>()
This method must always be used after the encoding is finished. It will
return zero or more MP3 frames.
=item B<encode_vbr_flush>(I<*FILE>)
This method may be called after B<encode_flush>() if a Xing VBR frame
is to be written to a file. Although not strictly required, if an MP3
stream was encoded as a VBR, the Xing frame contains information useful
to decoders, and is recommended to be used. If the MP3 stream is a constant
bitrate, calling this function performs no action. Also, if the output
stream is being emitted as a real-time stream, this function should not
be called, as it requires a file handle, and will perform a seek to to the
beginning of the file.
Important note: the file handle B<must> have been opened read/write (e.g.
open(FILE, "+>$filename"))
=back
( run in 1.699 second using v1.01-cache-2.11-cpan-39bf76dae61 )