Compresses a SoundFont 2 into a SoundFont 3: every sample a preset reaches goes through encode (one
call per sample, mono 16-bit frames, the codec named by codec, options passed along: an Opus bitrate
or a Vorbis quality level) and its bytes replace the frames; a
sample no preset reaches is dropped. Loop points become relative to their sample, as the format has
them, and each compressed sample's type gains the compressed flag. The font states the SoundFont 3
version in its INFO. Nothing here compresses: encode does, so a build tool can hand it ffmpeg for
Vorbis or Opus, or flacSampleEncoder for lossless FLAC with nothing installed. A SoundFont that
is already a SoundFont 3 comes back unchanged and encode is never called, whatever its codec: to
change the codec, decodeSoundFont it first.
Compresses a SoundFont 2 into a SoundFont 3: every sample a preset reaches goes through
encode(one call per sample, mono 16-bit frames, the codec named bycodec,optionspassed along: an Opus bitrate or a Vorbis quality level) and its bytes replace the frames; a sample no preset reaches is dropped. Loop points become relative to their sample, as the format has them, and each compressed sample's type gains the compressed flag. The font states the SoundFont 3 version in its INFO. Nothing here compresses:encodedoes, so a build tool can hand it ffmpeg for Vorbis or Opus, orflacSampleEncoderfor lossless FLAC with nothing installed. A SoundFont that is already a SoundFont 3 comes back unchanged andencodeis never called, whatever its codec: to change the codec,decodeSoundFontit first.