I recommend you sit this one out, as recording people, even if only audio and sending the sound over the internet is very much against the law in germany
Would that not mean that Shazaam is illegal Germany? From my limited searching it doesn't seem like it is.
Thinking this through more deeply, I agree and see your position. It is creepy to surveil audio and possibly send in full to Shazam. [edit: And post the original audio recordings online.] The ethical way to do this would be to use your own code to decimate the audio signal to extremely low dimensionality.
The legality of it only matters if you get caught. So don't use hardware or software that's traceable back to you, and be sufficiently careful to remain undetected when you install it. People often weigh the likelihood of being caught much, much higher than it actually is, and therefore conclude "I mustn't do anything illegal", which is irrational.
Which law are you thinking about in particular?
I expectation is that the microphone above the rooftop will not pick up on normal conversations, only louder stuff.
Installing stuff on public utility polls is probably illegal everywhere.
Recording conversations are illegal but if you could prevent that from happening, there is enough wiggle room that it has the potential to be legal.
Especially on a Sunday
The music fingerprinting on my Android phone works in airplane mode, so it would be possible with modifications. Also, it's likely that Shazam is sending a "hash" of the audio rather than an audio stream in most cases.