Add prepare() and finalize() functions and velocity.

Signed-off-by: TheSniperFan <thesniperfan@gmail.com>
Fix pausing being unreliable

Signed-off-by: TheSniperFan <thesniperfan@gmail.com>