First, he a took a press underling to task. He demanded that the furniture be sent back and that those responsible — including “that silly fellow who had his picture taken next to the bed” — be transferred to Alaska.
      
He then called Gen. Godfrey McHugh, his Air Force aide. “What the hell did they let the reporters in there for?” the president thundered. “You just sank the Air Force budget!”
      
And he was not finished venting his rage about the aide who appeared in the newspaper picture. “He’s a silly bastard!” he exclaimed. “I wouldn’t have him running around a cathouse!” Before hanging up, he characterized the entire episode with an expletive.
The story came straight from Kennedy himself.
      
Though even some of his closest aides did not know at the time, Kennedy recorded more than 260 hours of Oval Office conversations, telephone calls and dictation into his Dictaphone. The John F. Kennedy Library Foundation has culled the highlights into a new book of annotated transcripts and two audio CDs. Some of the audio portions will be available online.
      
The book, “Listening In: The Secret White House Recordings of John F. Kennedy,” with a foreword by his daughter, Caroline Kennedy, and an introduction by Ted Widmer, a presidential historian at Brown University, offers “the raw material of history,” said Thomas Putnam, the director of the Kennedy Library.
      
“This is the memoir that President Kennedy never got to write,” Mr. Putnam said.
In a meeting in November 1962, the president bluntly told James Webb, the NASA administrator, that putting a man on the moon was his top priority. Mr. Webb said it was more important to understand the environment of space, prompting Mr. Kennedy to say, “If we get second to the Moon, it’s nice, but it’s like being second anytime.”
      
Mr. Webb continued to push back, prompting the president to spell it out: “I’m not that interested in space,” he said, only in beating the Russians.
      
Kennedy’s obsession with the cold war extended to the athletic rivalry with the Russians over hockey. In March 1963, he called up an old friend who had played hockey in the Olympics to complain about the American men’s hockey team losing to Sweden, 17-2.
      
“Christ,” the president complained. “Who are we sending over there? Girls?”
      
Like Richard M. Nixon after him and several presidents before him, Kennedy installed hidden recording devices in the Oval Office. Almost no one knew about the practice until the existence of the Nixon tapes was revealed in 1973 during the Watergate hearings. This lifted the curtain on stealth self-bugging in the White House that began with Franklin D. Roosevelt.
      
Kennedy’s recording system was dismantled immediately after his assassination. The family kept the tapes until 1976 and then gave them to the National Archives. The Kennedy Library later acquired them and began to make them available to historians in 1983. Their release was a slow and laborious process because the sound quality was uneven and they had to be transcribed and declassified. The last 45 hours of tapes were released only this year.
      
Historians have turned to the tapes for insight into major events of the Kennedy presidency like the Cuban missile crisis, the civil rights movement and the Vietnam War. The value of this book, Mr. Putnam said, is that “it is the first time the material has been published in one collection with annotations and a serious historian providing context for each conversation.”
The book was published by Hyperion, which released a book last year of interviews conducted with Jacqueline Kennedy after her husband’s death.