"その子と話をするうちに、同じ歌手が好きだということがわかった" = While talking to him/her, I realized they liked the same singer as me. また During our conversation, I realized he/she liked the same singer as me.
I talked to a girl in my English class and found out she likes the same singer I do.
この場合、次のような言い方ができますよ。
ーI talked to a girl in my English class and found out she likes the same singer I do.
「英語のクラスで女の子と話をしていて、同じ歌手が好きだと言うことがわかった」
このように言うのが自然で良いかと思います。
ご参考まで!