(CNN) Cities have put spikes on ledges, installed bars on park benches and enacted tent prohibitions to keep homeless people from sleeping in public.

West Palm Beach, Florida, is trying something else: blasting popular children songs like "Baby Shark" and "Raining Tacos" all night long to discourage people from spending the night in a park.

"Raining Tacos" is an obnoxious song playing at Lake Pavilion in West Palm Beach. City officials say it's to deter people for congregating at the park late at night. Someone is still out here sleeping through it @CBS12 pic.twitter.com/YqJZHBU8fw — Madeline Montgomery (@MadelineTV) July 11, 2019

City spokeswoman Kathleen Walter said in a statement that the city plays music overnight at the Waterfront Lake Pavilion to discourage "congregating at the building" and to "encourage people to seek safer, more appropriate shelter."

"The music volume complies with City code, and is a temporary measure, as we are exploring the possibility of having set hours for the Great Lawn and Pavilion," Walter said.

West Palm Beach has been playing music at the Waterfront Lake Pavilion.

In 2001, West Palm Beach Police blasted classical pieces from Mozart, Bach and Beethoven from an abandoned building in an attempt to reduce crime and loiterers, according to the Orlando Sentinel.

Read More