The code in this screenshot will capture 2 seconds from the mic and play it back.