I want to write an audio file (the particular format does not matter to me) by hand, i.e. for each frame I would write manually which frequencies are present at which intensity. How do I do this? Is there some specialized software for this?
Are you sure you want to? An audio file contains samples. Each sample is the amplitude at a specific moment. Amplitudes should be both positive and negative. The sound you hear is because the amplitude changes over time. You may look at the wave form in just about any audio editor, lets say Audacity and then zoom in.
Typically you would have 44100 samples each second, the old CD standard. In order to make, say a 441 Hertz sound (a very slightly sharp mid A), you have to enter 100 samples in order to get one wave form. The value would modulate between, say, +1 and -1 start at zero in beginning, pass zero in the middle and end up at zero. You could then copy this 441 times to get one second of sound.
As for +1 and -1 above, it depends on the software you use. In a 16 bit wave file it would be around +32700 and -32700 for a max volume sound, less if you want to decrease the volume.
You could use Audacity to make this, but it would be tedious. The typical way to make a sound is instead to use a software synth, set it to perhaps sine oscillator and then play it.
As a beginner, I followed this tutorial to write a .wav file from scratch. If you just pust your values in a table instead of the sinewave he's making in the tutorial it should be pretty much what you wanted to do.
Have a great day !