Sound

How do i add sound so that every time my if statement in a function i have is true, it plays a certain sound?

I need it to play a beep sound when the poing ball touches the computers paddle or the players paddle.