Jimmy Stewart, generated by artificial intelligence, reads a bedtime story for the Calm app

Can not you sleep. You’re tossing and turning. You want someone to read you a nice, wholesome bedtime story. And you want that someone to be actor Jimmy Stewart.

The sleep and meditation app Calm released a new story for premium users on Tuesday told by Mr. Stewart, the beloved actor who starred in “It’s a Wonderful Life.” But the voice in their ears that puts them to sleep isn’t that of Mr. Stewart, who died in 1997. It’s a version of his signature drawl generated by his artificial intelligence.

“Well, bye. I’m James Stewart, but you can call me Jimmy. I’m going to tell you a story tonight,” the clone of Mr. Stewart’s voice begins, telling listeners to make themselves “nice and comfortable.”

“It’s a moving story of love, loss, hope and joy,” the voice continues. “But above all, it’s a wonderful story of sleep.”

The app is known for its “Sleep Stories”: stories read by celebrities including Idris Elba, Matthew McConaughey and Harry Styles to help users fall asleep. But for her affair with Stewart, she asked for help from Playera Ukraine-based company that uses artificial intelligence technology to produce synthetic speech and clone voices.

The story, written by Calm’s creative team, is the first of the celebrity narratives to use an AI-generated voice, a spokesperson for the app said Tuesday, adding that the company worked closely with the actor’s family on the project. “Stewart is one of history’s most beloved actors, with a voice that is moving to many,” the spokeswoman said in an email.

Respeecher said CMG Worldwide, the company that manages Mr. Stewart’s licensing, approved the project. CMG said in a statement: “The ability to replicate and integrate artists’ unique voices into contemporary works introduces a dynamic fusion of tradition and innovation.”

Similar projects may be on the way, the company added, saying it wants to “bring many of the icons we represent to a whole new generation of admirers,” according to marketing manager Tina Xavie.

“This technology not only enables the continuation of the artistic contributions of those who have passed away, but also provides living artists with revolutionary new avenues of expression,” the statement reads.

To revive Mr. Stewart’s voice, Respeecher fed recordings of the actor into its system to train it to recognize the voice. He then combined it with that of a voice actor who read the new story, Alex Serdiuk, CEO and co-founder of Respeecher, said in a video interview from Kiev.

“The voice is iconic. It’s very relatable, she said, adding that it ties in well with Christmas. “It’s just an interesting story and contributes a lot to mental health awareness.”

The growing use of artificial intelligence to recreate the likenesses or voices of public figures in film, television and other content has become a controversial issue. Meta, for example, has introduced AI characters based on celebrities like rapper Snoop Dogg and former NFL quarterback Tom Brady that it will soon weave into its products.

Critics have raised questions about the ethics and regulation of the practice. The use of artificial intelligence by studios and entertainment companies has been one of the concerns at the center of walkouts this year by Hollywood writers and actors.

Last month, actor Tom Hanks and journalist Gayle King warned their social media followers that their images had been used in unauthorized advertisements. Cybersecurity experts have also warned that technologies such as “voice deep fakes” could help scammers steal from people or businesses or commit other crimes.

Mr. Stewart’s family agreed to Project Calm, according to Varietywho had previously reported the story.

Playerfounded in 2018, has synthesized voices for 150 projects, including football coach Vince Lombardi for a video about a Super Bowl. She is currently working with Warner Music France, she said, on an “animated biopic” of the French artist Edith Piaf, who died in 1963, which she will use artificial intelligence to generate her likeness and voice. Her technology can also produce voice-overs for media that would otherwise be laborious for actors to record, or convert recordings into other languages ​​using the actor’s original voice.

The company said it does not allow its technology to be used for “deceptive uses,” including uses that could compromise the subject’s privacy and ability to find employment.

“In practice, this means we will never use the voice of an individual or actor without permission,” the site says, but adds that the company would allow “non-misleading uses” of historical and political figures.

Mr. Serdiuk said the company is aware of concerns related to voice technology. They introduced it with ethics policies that have only become more stringent, he said, regarding obtaining consent for the use of any intellectual property. “We don’t allow anyone to use our technology or our tools to introduce a voice that they don’t have rights to,” he said.

He added that he planned to listen to Jimmy Stewart’s story later that evening before going to bed.