During spring 1877 Edison failed in his attempt to emboss an alphabet for telegraphy. This fictional "alphabetic phonograph" of May 1878 translates Edison's original concept into action.
In Mark Twain's minor novel "The American Claimant" (1892) Colonel Sellers proposes that ships be equipped with phonographs loaded with swear words (because sailors won't work unless sworn at) "Five years from now ALL the swearing will be done by machine"
just as an aside, and a bit off topic, The fictional alphabetic phonograph picture reminds me of something older, but unfortunately not fictional....which is one of those musical instrument attempts for which the world is richer without! It was a thing called a Katzenklavier (cat piano) 17th century
Like a piano but with strings replaced with cats. Cats arranged by meow in a chromatic scale.
When player pressed a key, a pin hits the designated cat.
How anyone could have come up with this idea beats me. His first name must have been Catdolf
There was a Sherlock Holmes story where Homes deceived the villain by plaing a recording of a violin, making the bad guy believe Holmes was in another room, occupied, while in fact he was hiding behind a curtain - or something like that - it's a long time ago that I read it. But it does present an optimistic view of the quality of recordings at the time, and doesn't say much for the ears of the criminal!