"Under the Train Horn Rule (49 CFR Part 222), locomotive engineers must begin to sound train horns at least 15 seconds, and no more than 20 seconds, in advance of all public grade crossings.
If a train is traveling faster than 60 mph, engineers will not sound the horn until it is within ¼ mile of the crossing, even if the advance warning is less than 15 seconds.
There is a "good faith" exception for locations where engineers can’t precisely estimate their arrival at a crossing and begin to sound the horn no more than 25 seconds before arriving at the crossing.
Train horns must be sounded in a standardized pattern of 2 long, 1 short and 1 long blasts. The pattern must be repeated or prolonged until the lead locomotive or lead cab car occupies the grade crossing. The rule does not stipulate the durations of long and short blasts.
The maximum volume level for the train horn is 110 decibels which is a new requirement. The minimum sound level remains 96 decibels."
Courtesy of: FRA Train Horn Rule