added support for chosing starting idx when generating pcm