Added maxframes.  Stopped playing once maxframes reached