Yes it's called lucid dreaming. And don't automaticaly assume you were talking to yourself. The dream world when you'r in it is just as real as this one and has it's own conscious inhabitants.
I'm sure you're talking about Astral Projection there.
Lucid dreaming is basically all within your own head, where Astral Projection you leave your physical body and enter the 'Astral Plane'.
Codec, talking to that person in your dream you were basically talking to your subconscious mind. I read you can ask them (yourself) things about yourself, what you really desire etc., would be interesting. Lucid Dreams are fascinating!



Cue my mind desperately trying to cling on to the dream and failing.