Thomas Hardy's poem, The Darkling Thrush, is written in hymn meter, i.e. alternating lines of iambic tetrameter and iambic trimeter rhymed ABAB. This sound device contributes to the religious atmosphere of the setting, although in this case, it is the thrush that is singing the hymn because the narrator has lost his faith.
The main figure of speech contributing to the setting is personification of the thrush, which makes the warmth of its voice contrast even more with the bleakness of the external setting.
Similes and metaphors, comparing the scenery to dregs, broken lyre strings, the century's corpse, etc. also contribute to the despair of the setting.