MOGADISHU, Somalia — At least 14 radio stations here in the capital stopped broadcasting music on Tuesday, heeding an ultimatum by an Islamist insurgent group to stop playing songs or face “serious consequences.”

The threat left radio stations scrambling to scrub even the briefest suggestion of music from their daily programming. “Bam! Bam! Bam!” — the sound of gunshots that Somalis in Mogadishu have grown accustomed to hearing — was played by Radio Shabelle on its news broadcast to replace the music it usually uses to introduce the segment.

Similarly odd sounds — like the roar of an engine, a car horn, animal noises and the sound of water flowing — were used to introduce programs on some of the other radio stations that stopped playing music.

“We have replaced the music of the early morning program with the sound of the rooster, replaced the news music with the sound of the firing bullet and the music of the night program with the sound of running horses,” said Osman Abdullahi Gure, the director of Radio Shabelle radio and television, one of the most influential stations in Mogadishu.