This is merely a modification of somnambulism, and proceeds from similar causes, namely, a distribution of sensorial power to the organs of speech, by which means they do not sympathize in the general slumber, but remain in a state fit for being called into action by particular trains of ideas.
If, for instance, we dream that we are talking to some one, and if these organs are endowed with their waking share of sensorial power, we are sure to speak. Again, the mere dream, without a waking state of the organs, will never produce speech; and we only suppose we are carrying on conversation, although, at the time, we are completely silent. To produce sleep talking, therefore, the mind, in some of its functions, must be awake and the organs of speech must be so also. The conversation, in this state, is of such subjects as our thoughts are most immediately occupied with; and its consistency or incongruity depends upon that of the prevailing ideas being sometimes perfectly rational and coherent: at other times full of absurdity.
The voice is seldom the same as in the waking state. This I would impute to the organs of hearing being mostly dormant, and consequently unable to guide the modulations of sound. The same fact is observable in very deaf persons, whose speech is usually harsh, unvaried, and monotonous. Sometimes the faculties are so far awake, that we can manage to carry on a conversation with the individual, and extract from him the most hidden secrets of his soul. By such means things have been detected, which would otherwise have remained in perpetual obscurity.