There are a few possibilities to consider:
Inner voice: The human mind has an inner voice that we use for self-talk and internal dialogue. Sometimes, this inner voice can take on different tones or even mimic other voices. It's possible that in your moment of distress, your mind generated a comforting voice as a way to console or reassure you.
Auditory hallucination: In some cases, people may experience auditory hallucinations, which involve perceiving sounds or voices that aren't present in the external environment. These hallucinations can be caused by various factors, including stress, fatigue, emotional distress, or certain medical conditions. However, it's important to note that a single instance of hearing a voice doesn't necessarily indicate a hallucination.
Subconscious processing: Our subconscious mind continuously processes information, emotions, and experiences in ways that may not be immediately accessible to our conscious awareness. It's possible that your mind processed your distress and generated a reassuring message that you heard as an external voice. This can be seen as a manifestation of your subconscious trying to comfort you.
If you find that these experiences persist, cause distress, or significantly interfere with your daily life, it may be helpful to consult a mental health professional. They can provide a more personalized understanding and offer guidance based on your specific circumstances.