Every teacher seems to have his or her own way of getting the classroom focus back to the subject at hand. Sometimes they revert to the kindergarten clapping cadence, (clap, clap, pause, clap, clap, clap).
Some use gentle soothing musical chimes, musical instruments, sing and repeat cues. A few can be found here on YouTube:
All of these work pretty much for the classroom teacher and sometimes work for me.
If that doesn't work, my backup attention grabber is to walk toward the "homework box" on the board with the dry-erase marker in hand to add letters to the word "HOMEWORK". It works MOST of the time to get the class back under control.
A few weeks ago a friend of mine gave me a joke gift of the "Yodeling Pickle" also works pretty good as an attention grabber.