When the punishment is capital, or the sentence discretionary, it is common with us in England to preface it with such a speech.

RP Book 3 Chapter 3 Section 1