Play Subset of audio file using Pyglet
It doesn't appear that pyglet has support for setting a stop time.  Your options are:

Poll the current time and stop playback when you've reached your desired endpoint.  This may not be precise enough for you.
Or, use a sound file library to extract the portion you want into a temporary sound file, then use pyglet to play that sound file in its entirety.  Python has built-in support for .wav files (the "wave" module), or you could shell out to a command-line tool like "sox".
How can I use the pyglet API for sound to play subsets of a sound file e.g. from 1 second in to 3.5seconds of a 6 second sound clip?
I can load a sound file and play it, and can seek to the start of the interval desired, but am wondering how to stop playback at the point indicated?