which of the below given two sentences is correct? If both are correct, what is the difference in meaning between them?

1)She was heard **to sing** a song by them.

2)She was heard **singing** a song