A voice duplicator or voice synthesizer is a mechanism or method for imitating the voice of another individual. Technology of this sort is used chiefly for subterfuge. An individual with a sample of the real voiceprint, a sample of the imitation, and analysis software can sometimes detect the deception. Voice duplicators can be standalone instruments, or they can be incorporated into more complex machinery.
In 2266, the self-aware android Ruk demonstrated the ability to duplicate the voice of anyone he had heard. He later attempted to deceive James T. Kirk with this ability, but Kirk, having seen it demonstrated, was not fooled. (TOS: "What Are Little Girls Made Of?")
The Gorn possess voice duplicator technology good enough to fool at least an unsuspecting listener. After their attack on Cestus III, they used this technology to trick Kirk into visiting the destroyed colony, and bringing along his tactical specialists. Their goal was to isolate these men so that an emplaced ground force could destroy them quickly. (TOS: "Arena")
In 2267, Anan 7, then leader of the Eminian Union, used a voice duplicator to imitate Kirk. His goal was to lure the crew of the USS Enterprise to the surface of Eminiar VII so they could be killed in accordance with a treaty he was obligated to enforce. Montgomery Scott, in command of the ship, was able to discover the deception using a computer analysis. (TOS: "A Taste of Armageddon")
In the 24th century, several artificial lifeforms in service of the Federation had the ability to duplicate voices. In 2367, Lieutenant Commander Data, under the influence of a signal sent from his creator, was able to duplicate the voice of Captain Jean-Luc Picard and commandeer the USS Enterprise-D. (TNG: "Brothers")
In 2372, an operative of The True Way terrorist group used a voice synthesizer to duplicate Worf's voice. He did so in order to trick Odo into releasing control of a turbolift to him so he could use it in an attempt to assassinate Shakaar Edon. (DS9: "Crossfire")