I've had the experience of having migraines with aphasia- this is essentially a migraine aura that affects the part of the brain that processes language. I can confirm that while this was happening, i was aware of my surroundings and able to have thoughts, but I was unable to speak and unable to understand spoken or written language. It all just looked and sounded like gibberish. I thought about whether I should go to a hospital, what was going on, wondered whether my loved ones were concerned, and so on, but was unable to communicate any of those thoughts to other people. It was a bizarre experience.