Teachers across the country will soon be able to train for an active shooter on school grounds using a computer simulation that includes realistic details like gunfire, shattered glass and the screams of children.

This vivid and realistic digital simulation was created by the federal government. It was modeled after a real school and includes 20 classrooms, a library, a cafeteria and a gymnasium with blue-padded walls.

To depict the chaos of a school shooting, the software developers studied audio dispatches from the mass killings at Virginia Tech in 2007 and Sandy Hook Elementary School in 2012.

“It is a very traumatic, very panicky situation,” said John Verrico, a spokesman for the Department of Homeland Security, which funded the $5.6 million program. “We tried to make the environment just that disturbing.”