The default is 'I didn't know that.'
As a rule of thumb, I think you could say that you can't use 'this' unless you are touching or holding a physical object, or pointing to it from touching distance (a very few inches or centimeters), or standing very near it if it's something bigger, like the Statue of Liberty in TT's example.
In both JGMcI's and Tom's examples with 'I didn't know this,' the speaker has a written text in his hand that he has just read, and he is physically holding it or pointing to it.
And in Ulrich05's example with the food, the speaker says 'Did you taste this?' only when he is physically holding the food or pointing to it from very short range, almost touching it.
In JoeW's example, the speaker is listening to the music in the same room, so it counts as being close to him. However, if he heard the music from a distance away, so that it was not close to his ears but coming from a certain direction, another place, he would say 'that music.'
However, in all other contexts where you're referring to an idea or a piece of information that exists only in your mind, it is not considered to be in touching distance, so you use 'that':
Let's go to the park for a break from all the shopping frenzy. That's a good idea.
I just heard that the boss is taking the rest of the year off. Hmpf. That's interesting.
Christmas Eve is on a Sunday this year? Really? I hadn't realized that.