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
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.
Ctrl-F in that document for 'hashing'. That step reduces the audio information to a sparse collection of key points, one for each of four frequency ranges per time segment. I would assume that everything up to that step is done on the phone and only the key points are sent to the server.
Well it's you a person who is recording the music. So it's the user's responsibility to make sure you are not breaking any laws. So the app cannot be held at fault for this. No one cares if you do a Shazam in public so it all just works out.
But if you set up an autonomous recording device, no matter what you say you are doing, you will have problems.
Shazam is not illegal in Germany unless I missremember what the app does and instead of being to identify songs based on samples, it's being used to record people
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.