Workaround I ended up using was to convert my .mp3 files to .wav, and that stopped them from being cut off. The conversion was easy enough, and it might help down the line since .wav seems to be more acceptable for a variety of tools, e.g. aplay
.
I looped through each of them and used the tool lame
to convert
sudo apt-get install lame
lame --decode /path/to/file.mp3 /new/path/to/file.wav
Since I happened to be having this problem in Node, I'll share that full solution to convert all .mp3 files in a directory to .wav in a loop. This assumes you have a folder full of only mp3 files, and doesn't check to enforce that:
const fs = require("fs");
const { exec } = require("child_process");
const files = fs.readdirSync("./audio_mp3/");
files.forEach((file) => {
let newFile = file.replace('.mp3', '.wav')
exec(`lame --decode ./audio_mp3/${file} ./audio_wav/${newFile}`);
console.log(`Created ${newFile} in folder ./audio_wav/`);
})
/usr/bin/mplayer -ao alsa -really-quiet -noconsolecontrols <file | stream>
– Overdraw