Apple has bought headphone maker Beats Electronics for $3bn in a deal that ranks as the iPhone giant’s largest ever.Apple will pay $2.6 billion up front, plus another $400 million over time. Apple’s getting stylish hardware from Beats Electronics and a streaming service with Beats Music.The growing popularity of music streaming services such as Pandora and Spotify has been reducing sales of songs and albums, a business that iTunes has dominated for the past decade. U.S. sales of downloaded songs slipped 1 percent last year to $2.8 billion, while Apple is counting on the Beats acquisition to boost its cachet with teenagers and younger adults while trying to remain a leader in digital music — an industry that looks much different from when Apple reshaped the scene with the 2001 debut of the iPod music revenue surged 39 percent to $1.4 billion, according to the Recording Industry Association of America.

With $1.1 billion in revenue last year, Beats is already making money and will boost Apple’s earnings once the new fiscal year begins in October, Apple CEO Tim Cook said in an interview.

“We have known these guys forever,” Cook said of Iovine and Dre. “We’ve dated, we’ve gone steady, and now we are getting married. This relationship started a decade ago, so we know there is an incredible cultural fit. These two guys have a very rare set of skills. It’s like finding a particular grain of sand on the beach. It’s that rare.”

This image, including Apple CEO Tim Cook and rapper Dr Dre, centre, was released after the deal was announced

Beats was founded in 2008 by Dr. Dre, now a hip-hop producer, and Iovine, a longtime recording industry executive who is currently chairman of Universal Music Group’s Interscope Geffen A&M Records. It now dominates the luxury headphone market. Its equipment also has been a big seller in Apple’s stores.