John Fitzgerald Kennedy (1917-63), pictured in the 1960s in the USA.
John Fitzgerald Kennedy (1917-63), pictured in the 1960s in the USA.AFP/Getty Images

We can now hear former US president John F Kennedy 's final speech he was about to deliver at Dallas on November 22, 1963, thanks to voice synthesis technology. Kennedy couldn't make the speech as he was shot dead on the way to the venue by Lee Harvey Oswald

The 2,590-word speech can be heard in Kennedy's signature Boston accent and modulation now, as sound engineers from the Scottish company CereProc spent two months on the project to recreate it. 

The engineers synthesized 116,777 voice samples — each 0.4 seconds long — from 831 of Kennedy's speeches and radio address to assemble the speech with the exact tone and cadence that his diction would have delivered.

The recording was published Friday on The Times' website, as the British newspaper had commissioned the project too in the first place.

The sound units were first split into half units – known as phones – and then analyzed for pitch and energy. They were then tested next to each other to ensure they did not clash, as Times reported.

For example, the W sound in 'weapons' isn't the same as that in 'words'. "There are only 40 to 45 phones in English, so once you've got that set, you can generate any word in the English language," said Chris Pidcock, co-founder at CereProc in Edinburgh.

"The problem is that it would not sound natural because one sound merges into the sound next to it so they're not really independent," he said. "You really need the sounds in the context of every other sound, and that makes the database big."

CereProc' specialization is in text-to-voice technology. Companies use the engineering to bring characters and products to life. Medically, treatments also provide it as a substitute to those losing their voice due to ailments, so they can maintain their own voice.

However, recreating the late president's voice for the "JFK Unsilenced" turned out to be a lot more difficult challenge than expected.

"Because of the old analogue recording devices used, it appeared as if it was a different person speaking each time. Trying to harmonize the environment and manipulate the audio so that it ran together was quite difficult," Pidcock told The Times.

A lipstick print marks a framed photograph of former U.S. President John F. Kennedy at the National Press Club on the same day that former Texas Governor and Republican presidential candidate Rick Perry addresses the club luncheon July 2, 2015 in Washingt
A lipstick print marks a framed photograph of former US President John F. Kennedy at the National Press Club on the same day that former Texas Governor and Republican presidential candidate Rick Perry addresses the club luncheon July 2, 2015 in Washington, DC.Chip Somodevilla/Getty Images

"One of the things we needed to do is get a very accurate transcription of the audio so that things like 'umms' and 'ehs' could be labeled and we could make sure the phonetic pieces we got were correct," he said. "If you label them incorrectly, you might pick the wrong piece and the whole sentence will sound wrong."

The 21-minute speech, which was scheduled to be delivered at the Dallas Trade Mart, detailed the risks of populism and the importance of freedom.

"Ignorance and misinformation can handicap the progress of a city or a company, but they can, if allowed to prevail in foreign policy, handicap this country's security," the speech says.

"In a world of complex and continuing problems, in a world full of frustrations and irritations, America's leadership must be guided by the lights of learning and reason — or else those who confuse rhetoric with reality and the plausible with the possible will gain the popular ascendancy with their seemingly swift and simple solutions to every world problem."