Sakuraqwq1/moonmp3-encoder/src/mp3 does not have a README file
pub suberror AnalysisError {
BadStepLength(Int)
BadGranuleLength(Int)
BadBlockLength(Int)
}pub suberror Count1Error {
BadLength(Int)
BadValue(Int)
BadChannels(Int)
BadFrames(Int)
BadGain(Int)
FrameOverflow(Int)
}pub suberror EncodeError {
UnsupportedSampleRate(Int)
UnsupportedChannels(Int)
NotInterleaved(Int)
EmptyInput
AnalysisFailed(Int)
HuffmanFailed(Int)
}pub suberror HuffmanError {
Unrepresentable(Int)
BadRegion(Int)
}fn AnalysisFilterbank::step(self : AnalysisFilterbank, samples : Array[Double]) -> Array[Double] raise AnalysisErrorS[m] = sum(n = 0..511) x[n] C[n] cos((2m + 1)(n mod 64 - 16) pi / 64)fn ChannelAnalysis::granule(self : ChannelAnalysis, pcm : Array[Double]) -> Array[Double] raise AnalysisErrorfn ChannelAnalysis::granule_block(self : ChannelAnalysis, pcm : Array[Double], block_type : Int) -> Array[Double] raise AnalysisErrorpub struct FrameSizer {
numer : Int64
denom : Int64
base : Int
emitted : Int
total : Int64
}pub(all) struct GranuleInfo {
part2_3_length : Int
big_values : Int
global_gain : Int
scalefac_compress : Int
window_switching_flag : Int
block_type : Int
mixed_block_flag : Int
table_select0 : Int
table_select1 : Int
table_select2 : Int
subblock_gain0 : Int
subblock_gain1 : Int
subblock_gain2 : Int
region0_count : Int
region1_count : Int
preflag : Int
scalefac_scale : Int
count1table_select : Int
}fn GranuleInfo::big_values(part2_3_length : Int, big_values : Int, global_gain : Int, table : Int) -> GranuleInfofn GranuleInfo::scaled(part2_3_length : Int, big_values : Int, global_gain : Int, table : Int, scalefac_compress : Int) -> GranuleInfofn GranuleInfo::short(part2_3_length : Int, big_values : Int, global_gain : Int, table : Int, scalefac_compress : Int) -> GranuleInfofn GranuleInfo::switched_long(part2_3_length : Int, big_values : Int, global_gain : Int, table : Int, scalefac_compress : Int, block_type : Int) -> GranuleInfofn GranuleQuantiser::band_error(self : GranuleQuantiser, values : Array[Int], gain : Int, scalefactors : Array[Int], scalefac_scale : Int, band : Int) -> Doublefn GranuleQuantiser::error_scaled(self : GranuleQuantiser, values : Array[Int], gain : Int, scalefactors : Array[Int], scalefac_scale : Int) -> Doublefn GranuleQuantiser::error_scaled_short(self : GranuleQuantiser, values : Array[Int], gain : Int, scalefactors : Array[Int], scalefac_scale : Int) -> Doublefn GranuleQuantiser::quantise_scaled(self : GranuleQuantiser, gain : Int, scalefactors : Array[Int], scalefac_scale : Int) -> Array[Int]fn GranuleQuantiser::quantise_scaled_short(self : GranuleQuantiser, gain : Int, scalefactors : Array[Int], scalefac_scale : Int) -> Array[Int]let BaseFrameBytes : Intlet BitrateIndex128 : Intlet HuffmanSymbols : Intlet LinesPerGranule : Intlet LongFrequencyBandCount : Intlet LongScalefactorBandCount : Intlet ModeStereo : Intlet QuantizeOffset : Doublelet SampleRateIndex44100 : Intlet ScalefactorsInGroup1 : Intlet ScalefactorsInGroup2 : Intlet ShortBlockSamples : Intlet ShortFrequencyBandCount : Intlet ShortScalefactorCount : Intlet ShortSynthesisGain : Doublelet StepSamples : Intlet SynthesisGain : Doublefn block_window(block_type : Int, index : Int) -> Doublefn encode_count1_spectrum(frames : Int, channels : Int, spectrum : Array[Int], global_gain : Int) -> Bytes raise Count1Errorfn global_gain_for_peak(peak : Double, top : Int) -> Intfn long_block_window(index : Int) -> Doublefn matrix_element(subband : Int, tap : Int) -> Doublefn pair_cost(table : Int, x : Int, y : Int) -> Intfn scalefactor_band_end(band : Int) -> Intfn scalefactor_band_of_line(line : Int) -> Intfn scalefactor_band_start(band : Int) -> Intfn scalefactor_band_width(band : Int) -> Intfn scalefactor_bit_count(compress : Int) -> Intfn scalefactor_compress_for(max1 : Int, max2 : Int) -> Intfn scalefactor_step_multiplier(scalefac_scale : Int) -> Doublefn scalefactor_widths(compress : Int) -> (Int, Int)fn short_block_window(index : Int) -> Doublefn short_huffman_index(subband : Int, window : Int, line : Int) -> Intfn short_scalefactor_band_end(band : Int) -> Intfn short_scalefactor_band_of_frequency(frequency : Int) -> Intfn short_scalefactor_band_start(band : Int) -> Intfn short_scalefactor_band_width(band : Int) -> Intfn short_scalefactor_bit_count(compress : Int) -> Intfn short_scalefactor_of_line(line : Int) -> Intfn start_block_window(index : Int) -> Doublefn stop_block_window(index : Int) -> Doublefn table_extent(table : Int) -> Intfn table_linbits(table : Int) -> Intfn write_granule(w : BitWriter, values : Array[Int], table : Int, big_values : Int) -> Int raise HuffmanErrorfn write_header(w : BitWriter, bitrate_index : Int, samplerate_index : Int, mode : Int, padding : Int) -> Unitfn write_side_info(w : BitWriter, channels : Int, main_data_begin : Int, scfsi : Array[Int], granules : Array[GranuleInfo]) -> UnitInstall
Download zipPure MoonBit MPEG-1 Layer III encoder: 44.1 kHz mono/stereo, 128 kbps CBR, polyphase filterbank and MDCT, scalefactor bands, Huffman coding, zero FFI; 27.6-32.7 dB SNR on synthetic probes.