At the beginning, the goal of this home project was to create an Internet radio from the Raspberry Pi. I wanted to find or restore some old wooden receiver, or, at least, the case, put the Raspberry, the battery, the blackjack there, and that it would distribute the Wi-Fi. Due to time constraints, all of this was safely put on the back burner, but maybe, in time, I’m implementing it. But I made the program part of the project, which I want to talk about.
To make an old radio so that crystal clear modern bitrates sound from it - not comme il faut, in my opinion. That is, let them sound too, but for me it would be doubly pleasant to hear from the old radio the authentic sound of those times when there were no impulse transducers yet, and unicorns strolled around the streets blithely. The recipe for how to age sound, I imagine this way:
It is understood that the radio operates on medium wave, the time is evening, and the signal passes far. The list can be continued indefinitely, but the resources of Malinka are limited, and I want to start a lot of threads and switch between them. Therefore limited to the above listed. Designed all this in the form of a server based on Icecast and a number of other useful utilities. This server helps me to create a festive atmosphere in the New Year holidays. May be useful to someone else.
The principle of the server is as follows: two audio input streams taken from the Internet are converted to wav using ffmpeg, here the digitization frequency is reduced, in order to remove the upper frequencies, as well as to facilitate the work of the processor.
Next, the streams pass through an improvised sound processor written in C. I ask system programming experts to not kick me for possible errors, in everyday life I’m a web developer, and C for me is something like a quick version of bash. Here, each signal is assigned a level value taking into account fading, the signals are summed up taking into account the levels, then the total signal is divided by the value of the total level, thus AGC is simulated, and the volume of the received sound will be approximately constant.
The output stream is encoded by oggenc and sent via ezstream to the Icecast server, where it becomes available for listening.
You can clone the project from here , there is also an installation manual. Installing first is better not on Raspberry, but on regular desktop Linux, since it may be necessary to tinker with the manual assembly of some components on the Malinka. Instead of the stream-template-1206am script, there was a script with my favorite radio stations, to protect them from possible habraeffect, and replaced conscience from remorse with caps. Put in place audio streams to your taste and may a warm tube sound be with you.
All good and happy holidays!
UPDATE: On the advice of the user, Logonoff has added a sample of how it sounds to the project.
Source: https://habr.com/ru/post/435096/
All Articles