First, you're misusing the set message for buffer~. That is used to
change the name of the buffer. If you want buffer to play something,
you need play~ or wave~ or something like that. I'm not sure exactly
what you're trying to do, but you could easily tell play~ to play any
"slice" that you like using the length in ms multiplied by which slice
you want (an int). There are few more objects needed in that, but you
can find them in the play~ helpfile.