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.
The music industry has a long, long history of people paying to put songs in prominent places. If you built it yourself you would be 100% confident that nobody was paying the person compiling the playlist to put songs on it.
Well, at least at first. If your playlist derived from the ambient music of a particular streetcorner in Berlin becomes popular enough, someone would probably try hanging out there blasting their new song 24/7. Someone else might try approaching you about working out a deal to pay you to slip their new song into the mix. And of course you can never know who's paying to put songs on whatever stations or playlists the locals are listening to.
Some pretty interesting things would probably happen as the result of your goofy little fun project getting big enough to start having these problems though.
What more could one possibly need than "it'd be fun to build"? Does everything in the world have to be novel and important? Or can some things just be cool and for fun?
What I was going for (but poorly expressed) is that if your goal is to figure out what people listen to within a geographical area, streaming service data seems far more comprehensive than putting one mic on one random street.
The goal here seems more focused towards informing people about the existence and imprecision of shot spotters than actually trying to determine anything about regional music interests.
[edit: It would be awesome if others could collaborate on this and had a guide on how to do it!]