Let's allow beginning and ending stream capture via stand-alone functions as well as the `begin_capture()` and `end_capture()` methods.