An app or site is not required to try to vet user uploads for copyright infringement.
If the site operator is in the US and wants the DMCA Safe Harbor, then the site must offer a way to file takedown notices, and must respond to them properly (as described in more detail in the linked answer). If the operator does not accept takedown notices, the operator may be liable if an infringement suit is brought. If it fulfills the safe harbor requirements, then the site operator cannot be held liable in any such suit.
There are similar Safe Harbor laws in many countries.
But it is in no way illegal to allow uploads of possibly copyrighted content, and not investigate the copyright status until and unless a complaint is made by the copyright owner or the owner's agent in proper form.
The specific US law here is 17 USC 512(c). This provides, in relevant part:
(c)(1) In general.—A service provider shall not be liable for monetary relief, or, except as provided in subsection (j), for injunctive or other equitable relief, for infringement of copyright by reason of the storage at the direction of a user of material that resides on a system or network controlled or operated by or for the service provider, if the service provider—
(c)(1)(A)(i) does not have actual knowledge that the material or an activity using the material on the system or network is infringing;
(c)(1)(A)(ii) in the absence of such actual knowledge, is not aware of facts or circumstances from which infringing activity is apparent; or
(c)(1)(A)(iii) upon obtaining such knowledge or awareness, acts expeditiously to remove, or disable access to, the material;
...
(c)(3)(B)(i) Subject to clause (ii), a notification from a copyright owner or from a person authorized to act on behalf of the copyright owner that fails to comply substantially with the provisions of subparagraph (A) shall not be considered under paragraph (1)(A) in determining whether a service provider has actual knowledge or is aware of facts or circumstances from which infringing activity is apparent.
If an upload is made and processed by automatic means, without the personal intervention of the site operator or a member of the operator's staff, it is not usually considered that the operator has 'actual knowledge" of its infringing nature.
Whether, by providing facilities to upload form Amazon or similar commercial sources, the operator has awareness of "facts or circumstances from which infringing activity is apparent" is a question I do not know if any court has addressed. The operator could perhaps claim that s/he expects such a limited use to fall under fair use or a similar exception. In the absence of a takedown or similar notice from the copyright owner, it might be hard to successfully sue the operator
However, the user who publicly plays a piece of copyrighted music without obtaining permission is committing infringement (unless fair use or anothe exception applies). The copyright owner may choose not to sue small non-commercial users, but could sue if the owner chose to sue, and might well win such a suit.
The most common legal way for a club or school to play such music in public is to pay royalties to the copyright holder. Many countries, including the US have schemes operated by music associations that allow automatic licensing on payment of the royalty to them and they manage the disbursement to the copyright holder.
However, if fair use validly applies, then it is perfectly legal to play the music without obtaining permission or paying any royalty. whether this applies depends on the specific facts, and varies case-by-case.