2022.09.13 03:24
printing sound

I've been wondering lately if it would be possible (in practice, because in theory it obviously is) to print out a sound recording? For example, on an ordinary home printer, black-and-white, laser. So that it could be easily played back later. Probably using a computer, because how else? And how many pages would a short, let's say five-second, fragment take?
There's a trade-off here: it can be done so that the printout takes up fewer pages at the cost of making decoding harder later (because we use some fancy encoding), or vice versa, it takes up more pages but decoding is easier. And a very related trade-off: if we want the printout to be resistant to parts of it getting damaged, the printout needs to be larger.
For example, let's consider printing it as bytes written in hexadecimal (simply: DE AD BE EF...), with a size 12 font, bytes (i.e., pairs of characters) separated by spaces. On an A4 page, I can fit about 50 lines of 22 bytes each, which is 1100 bytes per page.
I considered two versions: printing it simply as PCM (so that playback would be very simple, even if part of the printout is damaged, it would be possible to play back what remains) and printing it encoded with the speex codec (https://en.wikipedia.org/wiki/Speex). I did some trials with a sample five-second speech fragment - encoding, listening to see what the quality would be, and calculating how many pages those five seconds would take up in print. Here are the results:

With PCM encoding:
22050 Hz, 16 bits - really nice quality - 220,500 bytes, which is 200 pages of print
22050 Hz, 8 bits - some noise appears, but otherwise everything is clear - 110,250 bytes, which is 100 pages of print
11025 Hz, 16 bits - a bit lacking in high frequencies - 110,250 bytes, which is 100 pages of print
11025 Hz, 8 bits - noise appears again - 55,125 bytes, which is 50 pages of print
8000 Hz, 16 bits - quality like from a tape recorder, but acceptable - 80,000 bytes, which is 72 pages of print
8000 Hz, 8 bits - noise appears again - 40,000 bytes, which is 36 pages of print
4000 Hz, 8 bits - quality is okay - 20,000 bytes, which is 18 pages of print
2000 Hz, 8 bits - quality is pretty pointless at this level - 10,000 bytes, which is 9 pages of print

With speex encoding:
22050 Hz, quality 8 - quality practically like PCM 22050 Hz 16 bits - 24,826 bytes, which is 22 pages of print
11025 Hz, quality 8 - quality practically like PCM 11025 Hz 16 bits - 13,732 bytes, which is 12 pages of print
8000 Hz, quality 8 - quality practically like PCM 8000 Hz 16 bits - 10,039 bytes, which is 9 pages of print
22050 Hz, quality 4 - slightly worse quality than PCM 22050 Hz 16 bits - 11,635 bytes, which is 10 pages of print
11025 Hz, quality 4 - slightly worse quality than PCM 11025 Hz 16 bits - 7,468 bytes, which is 7 pages of print
8000 Hz, quality 4 - slightly worse quality than PCM 8000 Hz 16 bits - 5,494 bytes, which is 5 pages of print

According to Wikipedia, speex is resistant to lost packets but not to damaged ones. I didn't study this thoroughly, but as a test, I tried introducing small damages to the file and listening to the results. It seems to me that if individual bytes or small groups of bytes are damaged, it's better (or at least not worse) to have a byte changed rather than lost - with even one lost byte, the whole piece (probably that frame) collapses - and with a changed byte, not necessarily (probably depends on whether the damage is in some frame header - I'm guessing there's something like that - or in the data). But if you print with a fixed-width font and number the pages, then even if some part can't be read, you can at least easily tell how many bytes there were and fill in zeros in their place.

comments:
2022.09.13 14:43 J

https://en.wikipedia.org/wiki/Sound-on-film


2022.09.14 03:41 P.

@J: tak, sound-on-film to też fajny pomysł. Ale wydruk na drukarce ma spore zalety. Można tanio wydrukować w każdej firmie, która drukuje prace dyplomowe (9 groszy za kilobajt plus 9,99 zł za oprawę plus 8,99 zł za wysyłkę inpostem w firmie https://wydrukiioprawy.pl/cennik , czyli - przy kodowaniu speex z jakością magnetofonową 11 groszy za minutę nagrania, a z jakością ładną (22050 Hz, quality=4) 40 groszy za sekundę). A takie zapisanie dźwięku na kliszy to pewnie nie bardzo byłoby gdzie zrobić. No i później po latach odczytanie z kliszy wymagałoby specjalnego sprzętu, a litery z papieru zawsze się jakoś łatwiej odczytałoby.



nickname:

enter digit "four": (this is a spam protection)

offensive comments or those I don't like will be deleted


back to homepage

RSS