Still, many think Apple is wasting its time with Beats. The music streaming service has an estimated 500,000 customers, puny compared to Spotify's 4 million subscribers. Pandora(P), which is valued by investors at $5.2 billion, has more than 250 million active accounts. Apple could buy 30 Pandoras right now.

But on Wednesday, CEO Tim Cook made his case. In a statement, he said the deal brings together "extraordinary teams so we can continue to create the most innovative music products and services in the world."

Apple expects the deal to close in late summer or early fall.

Apple has its mojo back

The winners of the deal are Beats co-founders Jimmy Iovine and Dr. Dre, both successful music producers who launched the company back in 2006 and quickly grew it via celebrity endorsements.

For his part, Dre is already calling himself "the first billionaire in hip hop." His stake in Beats, estimated at 20% to 25%, is expected to push his net worth of $550 million close to that number. But it's too early to tell if Dre is a billionaire just yet.Meanwhile, Iovine described the deal as a match made in heaven. He said the whole Beats concept was inspired by Apple's perfect blend of culture and technology.

"I've always known in my heart that Beats belonged with Apple," Iovine said in a statement.

Dre and Iovine are also joining Apple, so Iovine is stepping down from his perch as CEO of the record company Interscope Geffen A&M.