IT should not happen with toilet flushing as that is a MAJOR open valve, but the inlet has a check valve and at low flow it will indeed HUM a bit.
Also, when you close the valve watter hammer can happen. Here is how,,
Water is flowing, It wished to KEEP flowing but, alas, the valve is closed to the sudden stop causes it to kind of back up and crash about.
A bit like cars on the freeway tailigating when somethign happens up front.
The solution is an air chamber, (Called an anti hammer chamber by some) at the end of the line just ahead of the valve.
IN your house, under the sink you may see a short pipe that goes notwhere.. Yup, that's it.
Oh.. Did you know there is a device that takes ADVANTAG of this feature of water? Called a Hydraulic Ram Pump
What it does is let watter pass through, and when it's good and flowing it slams shut the pass throug valve and the flow causes a sudden increase in pressure.. .This sends the water through a check valve into a pressure vessle (Standard well water pressure tank) and from there up to a higher elevation or to your kitchen sink.. This kind of thing has been around since.. .Well long before this 60 year old was born is all I can say.