Your quote refers to Shakespeare's Sonnet 29, which is one of his most famous. It begins with these lines:
When in disgrace with fortune and men's eyes,
I all alone beweep my outcast state,
And trouble deaf Heaven with my bootless cries,
And look upon myself, and curse my fate . . .
If you read the entire sonnet you will see all his reasons for feeling despondent. However, towards the end of the sonnet he reminds himself that he has someone he loves and who loves him, and the mood of the sonnet changes from despondency to joy.
Haply I think on thee,--and then my state
(Like to the lark at break of day arising
From sullen earth) sings hymns at heaven's gate . . .
Note how the alliteration in "sings hymns at heaven's" enhances the image of a bird singing in the sky like a skylark. Shakespeare sometimes uses many figures of speech in sonnets and sometimes only a single one which he exhibits "like a jewel hung in ghastly night" (Sonnet 27).