Trim Audio Files Without Installing Software
I needed to extract a 30-second clip from a podcast episode to use as a sample in a presentation. My options: install Audacity (a 90 MB download with 200 features I don't need), use FFmpeg (powerfu...

Source: DEV Community
I needed to extract a 30-second clip from a podcast episode to use as a sample in a presentation. My options: install Audacity (a 90 MB download with 200 features I don't need), use FFmpeg (powerful but I'd need to figure out the timestamp syntax), or open a web-based tool and drag the trim handles. I chose the third option because sometimes the simplest tool is the right one. But the experience made me curious about how audio trimming actually works, both at the file format level and in the browser. Here's what I learned. How audio data is stored Digital audio is a series of numbers representing air pressure samples taken at regular intervals. CD-quality audio samples 44,100 times per second (44.1 kHz sample rate), and each sample is a 16-bit integer (values from -32,768 to 32,767). Stereo audio has two channels, so that's 88,200 samples per second, each 2 bytes, totaling 176,400 bytes per second -- about 10.6 MB per minute. Trimming uncompressed audio (WAV/PCM) is conceptually simple