Depending where the noise was coming from, but this question is most likely to be answered in this way. If you switched a valve off and the noise was coming before the valve in the pipes, that would indicate a burst pipe.
if the pipes are warm or hot at the time the coldwater passes though them, it can cause the pipes to cool and contract
A common cause of pipe noise in a home is when the pipes vibrate or rattle inside the walls. When the home was built, the plumber is supposed to install strapping around the pipe where it enters the studs in the wall or travels through the floor to prevent this. If this strapping was not secured and has fallen off (or never there to begin with) this will cause the pipe to rattle or vibrate when the water is turned on or off and cause the noise you are hearing. I don't think it is cause for alarm, but it definitely is annoying. Repairing this problem could be simple if the noise can be pin pointed. A licensed plumber should be contacted regardless.
choir members in your pipes
Do you only get the noise when you turn on the hot water? Not the cold water? I would think that it would be happening with both. For water to flow through your pipes, there has to be air present. Think of a straw filled with liquid and a finger on top. When you let the finger go, the water can flow. Now, the water in the pipe of a home is somewhere between 40 and 80 psi. With some pipe set ups, you create the horn sound with water rushing through the pipes when the valve is turned on. It is just like blowing air through the pipes of a brass instrument, such as a trumpet.
Singing water pipes can be caused by air that is trapped in the pipes. The air can cause a whistling or singing sound, or it can cause the pipes to knock or rattle.
Salt water cause corrosion on most metal pipes.
Decrease pressure to prevent excessive velocity
It is due to water hammering effect.
Usually dissolved calcium is the cause of scaling in pipes that carry water.
This is most likely to be water hammer. The most likely reason is because a pipe has not been held down properly with a pipe clamp. It normally happens when a toilet is filling up or when taps are switched off suddenly. Its due to the water pressure in the pipes that makes the water rebound in the pipes causing them to rattle and make a noise
This is water hammer and is caused by rattling pipes that are not secured down properly
Ask your plumber to install a water hammer arrester.