Fast way to generate a sample that can be visualized by minerl.viewer?

Hello,

Just curious if there’s a fast way (like a function call) to generate a sample that can be played by minerl.view?

Or can someone explain the general ideas about how to make it work?