This wasn't just an acting choice. Ronnie Barker had a naturally high-pitched voice, which he often used to comedic effect.
There was no specific incident or event that changed his voice; it was simply his natural vocal range.
However, some people might say that his voice changed slightly over time, possibly due to aging or the demands of his acting career.