std/audiomodulejsscheller/scrilib
Functions
compress
Compress an audio file by adjusting its bitrate.
convert
Convert between audio formats.
merge
Combine audio files.
trim
Trim an audio file.
waveform
Generate a waveform image frmo an audio file.

Time duration syntax

Time-duration syntax takes two forms:

  • Specify a timestamp - eg. 00:04:15.
  • Specify the number of seconds (with optional unit) - eg. 55 or 200ms.

Examples:

5555-seconds
0.20.2-seconds
200ms200-milliseconds
00:04:154-minutes and 15-seconds
02:04:052-hours, 4-minutes and 5-seconds
00:00:05.5005-seconds and 500-milliseconds (half-second)

Audio format overview

Formats like AAC, MP3, OGG, OPUS, and WMA are all lossy formats, which means that they discard some audio information to achieve smaller file sizes. They’re typically used for music or any situation where you want a good balance between file size and audio quality.

Formats like AIFF, FLAC, and WAV, on the other hand, are lossless formats, which means they reproduce the audio exactly as it was in the original source, at the cost of creating larger files. They’re typically used in professional audio and video production, or any situation where you need the highest possible audio quality.

MMF is a mobile sound format and has quite low bitrates in comparison to other formats. It’s primarily used for ringtones and mobile audio.

Codecs, bitrate and sample-rate for audio formats

FormatCodecsBitrateSample-rate
AACAAC32-320 kbps8000-48000 Hz
AIFFPCM_S16BE (default), PCM_S24BE, PCM_S32BEN/A8000-192000 Hz
FLACFLACN/A8000-192000 Hz
M4AAAC (default), ALAC32-320 kbps (AAC), N/A (ALAC)8000-48000 Hz
MMFADPCM_YAMAHAN/A8000-48000 Hz
MP3LIBMP3LAME32-320 kbps8000-48000 Hz
OGGLIBVORBIS64-500 kbps8000-192000 Hz
OPUSLIBOPUS6-510 kbps8000-48000 Hz
WAVPCM_S16LE (default), PCM_S24LE, PCM_S32LEN/A8000-192000 Hz
WMAWMAV248-192 kbps8000-48000 Hz