Re: [Tuxpaint-i18n] [Tuxpaint-stamps] Reduced bitrate of many stamp description sounds
An award-winning drawing program for children of all ages
Brought to you by:
wkendrick
From: Bill K. <nb...@so...> - 2024-06-02 17:34:04
|
On Sun, Jun 02, 2024 at 02:45:54PM +0200, Karl Ove Hufthammer wrote: > [Sorry for the late reply to this.] > > Bill Kendrick skreiv 12.01.2024 06:05: > > The other day I went through and converted all descriptive sound files > > in Tux Paint Stamps -- the sounds of people speaking the names of > > stamps -- from stereo to mono. That saved almost 100MB of space > > used by those OGG files! > > I think this is misguided. Ogg Vorbis uses channel coupling (similar to > joint stereo in the MP3 format), and since the recordings have been done by > (mono) microphones, converting from stereo to mono should in theory have > *no* effect. There were many recordings where the audio was only playing in one channel (e.g., if I had headphones on, I'd only hear the voice speaking the stamp description in my left ear, and silence on my right). That said... sounds like possibly I goofed some things up. :-| > I guess the reason that you saved 100 MB, is simply that you > lossily recompressed a lossy format, further reducing the quality > (introducing more artefacts). > > > > Today, I did further work, this time to reduce the bitrate of sounds, > > so they are never higher than 32,000bps. That saved another 41MB. > > Is this based on the already recompressed (mono) file? This will introduce > even more artefacts. You will have have encoded the file *three* times, > losing quality at each step: > > Original → Encode to Ogg → Reencode (mono) → Reencode (bitrate) > > See https://wiki.hydrogenaud.io/index.php?title=Transcoding > > It would be much better to encode to the final format from the *original* > uncompressed files (if you have them). Oof, yes, I would have to dig them back up from an earlier release I suppose. I admit, a lot of the localized sound samples we have were done by children in noisy environments and the quality of the recordings were very bad to begin with. I cast a wide net when I decided to try and shrink the filesize of the sound files. We have nearly 17,000 of them in tuxpaint-stamps; it felt like a months-long full-time job to sort out which ones would _truly_ benefit, and I guess I didn't expect much degregation happening to the higher-quality ones, by reencoding them to be smaller. (They still certainly sound way better than the ones which were bad recordings to begin with, to my ears.) > I have tried listening to the transcoded Norwegian Nynorsk files. They were > already in mono, so there is only a single recompression, but the audio > quality is noticeably worse. > > I have the original files, and can compress the files to ~ 32 kbps. This > should results in much higher-quality files. > > BTW, the algorithm for recompressing the files is also misguided. You first > test if the bitrate is higher than 32 kbps. If it is, you recompress to 32 > kbps. But the bitrate in Ogg Vorbis is a *nominal* bitrate, and you might > actually end up with a file that is bigger than 32 kbps after recompressing. > Also, if the quality of the original file is such that it doesn’t *need* 32 > kbps, you’re encoding at an unnecessarily *high* bitrate. It would better to > specify the quality (e.g., the ‘--quality’ argument in oggenc, for example > to -1). Thanks for explaining! > BTW, would it be possible for Tux Paint to support the Opus codec? This > results in much lower file sizes for the *same* quality. In my tests, I can > get the same quality as my original Ogg files but halving the file size (by > compress the original .wav files and using ‘opusenc --bitrate 24’ – and note > that despite the name, the ‘--bitrate’ argument specifies the *quality*, not > the actual bitrate). I assume we could based on https://wiki.libsdl.org/SDL2_mixer/FrontPage It supports 8 channels of 16 bit stereo audio, plus a single channel of music. It can load FLAC, MP3, Ogg, VOC, and WAV format audio. It can also load MIDI, MOD, and Opus audio, depending on build options (see the note below for details.) although: Support for software MIDI, MOD, and Opus are not included by default because of the size of the decode libraries, but you can get them by running external/download.sh So what do you think, should I open some tickets for these things? e.g.: 1. restore original sound files from pre-12/2024 and do a smarter job at compressing them, doing all of this at once (rather than lossily one step at a time): a. stereo->mono the truly bad stereo (sound in one channel, silence in the other) recordings b. reduce the quality level 2. investigate use of the Opus codec a. ensure it's usable on all major platforms (I assume Windows, Linux, macOS, and Android are good; Haiku would be the main question) b. using the files as they existed after step 1a, re-encode using Opus codec; assuming the file size is better (smaller) over all, use it Thanks again! -bill! > > > -- > Karl Ove Hufthammer > _______________________________________________ > Tuxpaint-stamps mailing list > Tux...@li... > https://lists.sourceforge.net/lists/listinfo/tuxpaint-stamps |