A speech by a person to herself is called a soliloquy. The soliloquy is a dramatic and literary form of discourse in which a character talks to herself or reveals her thoughts while she alone or unaware of the presence of other characters.
The playwright William Shakespeare artfully used soliloquies to reveal the minds of his characters in his plays. The self-addressed speech eventually faded out of the theater during the rise of dramatic realism in the 18th century. A soliloquy is similar to a monologue, a long speech that may be addressed to other characters or to the audience.