In 1995, Tom Hanks lent his voice to Woody, the trusty sheriff doll in Pixar’s “Toy Story.” Since then, Hanks has become a grandparent, while the films have evolved into a soulful meditation on growing up and the passage of time. “Toy Story 4,” out Friday, finds Woody moving on yet again, with what feels — for now, at least — like a conclusive ending.

Here, Hanks talks about the franchise and what it says about family, and the unique pleasures and demands of playing a children’s plaything. These are edited excerpts from the conversation.

Has the process of recording Woody changed much?

He still yells an awful lot. (Shouting) “Guys come on! We have to go! We just can’t leave her there, guys! Come on!” He is in some ways the compass of responsibility for everybody in the room. And he’s always been tightly wound.

There are times when my diaphragm is sore at the end of a four- or five-hour recording session, just because the challenge is to wring out every possible option for every piece of dialogue. It’s every incarnation of outrage and surprise and disappointment and heartache and panic and being plused and nonplused.