I believe it can be very clear in the programing language Mathematica, because you can graph and listen to a function with very similar commands. You can graph a function with this command:
On the other hand, you can listen to the function if you replace Plot with Play, and replace the 0.003 (which means 3 milliseconds in this context) with, for example, a 2 (so you listen the sound for two seconds):
When you "Play" a function in Mathematica, the values of the function are sampled and transformed to voltages, and those voltages are transformed into movement of the loudspeaker membrane, as EMV pointed out.
For your question, you would use ListPlot and ListPlay, which let you graph and listen data http://reference.wolfram.com/mathematica/ref/ListPlay.html
I am doing some material (most of the site is under construction) to teach exactly these concepts, you can read the PDF version in this link http://matecmaticaacustica.weebly.com/graph-and-sound-of-sine-waves.html and if you have either Mathematica or the free CDFPlayer, you can see the CDF version and interact with it, listening to functions and I have there a small app that might be useful. regards