Does masturbating affect the pitch of your voice?
When two events happen at nearly the same time, people will commonly conclude that one thing caused the other to occur, but it is not necessarily so. Consider for a moment that most boys don't discover masturbation until they are old enough to ejaculate semen. But a boy's first ejaculation usually doesn't happen until they reach Tanner's stage 3 when they enter their growth spurt. Along with the growth in height comes the expansion of the voice box, which produces a deeper sounding voice. This begins to happen in stage 3 and finishes in stage 4.
Thus masturbation doesn't cause the voice to deepen. Boys who never masturbate still will get deeper voices. What we have are two independent events that are both triggered by growing up. If anything caused them to happen, it is the hormones which are changing your body from a child into a man.