。
Whenever she felt lonely, she'd find comfort in music.
Literal
She [topic-は] lonely time [topic-は] always music [with-で] heart [object-を] was-comforting.
An evocative sentence about coping. 心を慰める ('to comfort the heart') is a literary collocation that frames music as something that soothes from within. The で here is the instrumental — 'with music, by means of music' — common with abstract verbs of effect (薬で治る 'cure with medicine,' 笑顔で迎える 'greet with a smile'). The double は (さびしい時は ... 心を慰めていました) is one of the genuine cases where two は particles coexist: the first marks the temporal frame ('as for lonely times'), the second is the conditional/topical 'as for those...' setting up the habitual response. Polite past continuous ~ていました locks the action into a habitual pattern over a stretch of time.