This is the 13259th most frequent Korean word.
듣던
"듣던" means "that I/you/we/he/she/they was/were listening to" or "used to listen to," depending on context.
In this sentence, '듣던' is used before '음악' to describe the music that was being listened to at some previous point.
듣던 음악이 끝났다.
The music I was listening to has ended.
Here, '듣던' modifies '이야기', indicating the story that one was in the process of hearing earlier.
듣던 이야기의 결말을 알고 싶었어요.
I wanted to know the ending of the story I had been hearing.
In this example, '듣던' describes the lecture, framing it as one where the listening occurred in the past or previous experience.