Skip to main content


Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: trying to get the most out of converting to 8bit audio.... (sox/ssrc) (Read 2428 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

trying to get the most out of converting to 8bit audio.... (sox/ssrc)

hi, i often use this forum as reference but dont generally post... if this belongs in another subforum let me know and i'll move it

i'm scripting a routine to convert 16/44 audio to a format for old amiga computers... specifically to 8bit wav at a variety of sample rates.

the amiga uses a unique way of playing back audio based on cpu clock and screen refresh. there's a variety of sample rates that are optimal... i'll choose one that SSRC doesn't complain about converting to, 27928...

so far my script is:

Code: [Select]
sox infile.wav tempfile.wav silence 1 0.1 -48.16d reverse silence 1 0.1 -48.16d reverse pad .5 .5

-> removes any audio below -48.16 dB at the start and end of the input file and saves the remainder to a tempfile. according to wikipedia 48.16 is the SNR of 8 bit audio. sox also pad's the tempfile with .5s of silence at the beginning and end because ssrc (below) seems to have problems with short samples of audio.

Code: [Select]
ssrc_hp --twopass --bits 8 --dither 2 --pdf 2 --rate 27928 --normalize tempfile.wav anothertempfile.wav

-> ssrc's noise shaping sounds better to my ear than sox, or that sox won't let me use most filter options below 44100

Code: [Select]
sox anothertempfile.wav final.wav trim 0.5 reverse trim 0.5 reverse

-> removes the .5s padding at the start and end because of the ssrc problem above and saves the final wav file.

here is an example of the above using a roland tr-808 bassdrum:

infile (16/44): 808in.wav
outfile (8/27828): 808out.wav

and another example using a roland tr-808 cymbal:

infile (16/44): cymin.wav
outfile (8/27828): cymout.wav

i'm curious if there's any way to improve the quality of the resulting audio. i know that's subjective... i'm mainly curious in which ways i can tweak or alter the settings in my script... for instance, if i could live without a few more decibels in SNR could i optimally reduce the amp of the noise shaping in ssrc... does that make sense? if so, then what that ratio would be... ie, -48.16 vs --amp of noise shaping...

or if i might alter the script depending on the frequency range of the infile...

or if there's some compression options in sox i could use that would reduce the noise shaping of the audio...

or, if there is a completely different way of doing things that might result in a file sounding better (less noise, no crazy artifacts), that would be awesome...

if someone can make those outfiles sound better, i'd be really interested and really grateful to hear them )

trying to get the most out of converting to 8bit audio.... (sox/ssrc)

Reply #1
was just thinking about something else...

i once wrote a bitcrusher effect that i added a LP/HP filter to because lower frequencies seemed to respond more dramatically to bit reduction...

its interesting in the above audio examples that the file with the lower frequency has more noise... maybe because of the noise shaping algorithm... but maybe because its more complicated to noise shape lower frequencies... just like how they seem to respond more to bit reduction...

i suspect that in the above audio examples if i used no noise shaping at all that the effect of bit reduction would still be more noticeable on the bassdrum example...

as if high frequencies require less bit and more rate and lower frequencies require more bit and less rate...


trying to get the most out of converting to 8bit audio.... (sox/ssrc)

Reply #3
thanks for giving it a shot. i tried your wav8bit3 utility but was unable to get as good of a result than with ssrc... to my ears anyway.

also, it seems that although 48.16dB is the SNR of 8 bit audio, another 6.02dB can be added for a total of 54.18dB. anything below that just results in noisy artifacts...

why an extra 6.02dB can be added, i'm not exactly sure... but i was looking at this page when i tried it:

for some reason i can't edit my post above, but the code should read:

Code: [Select]
sox infile.wav tempfile.wav silence 1 0.1 -54.18d reverse silence 1 0.1 -54.18d reverse pad .5 .5

also updated the outfiles.