Ultrasounds operate through emitting short wavelength, high frequency sound waves that are too high in pitch to be heard by the human ear.
Flies detect sound by special hairs or sensilla located on the antennae or genitalia.
A University study confirmed that ultrasonic sound devices do have both a repellent effect as well as reduces mating and reproduction of flies.
Flies respond to special ultrasounds by moving about a bit more than usual and appear eager to escape from the sound waves.