Apple is striking a new chord with a $3 billion acquisition of headphone and streaming music company Beats Electronics.

Wednesday’s announcement confirms earlier reports of an imminent deal. It’s by far the most expensive acquisition in Apple’s 38-year history, a price that the company is paying to counter a threat posed to its iTunes store.

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.

Apple Inc. broke into music streaming with the launch of iTunes Radio last September, but the Beats deal is a sign that the service hasn’t been a big hit.

Beats launched its streaming service earlier this year to supplement its trendy line of headphones.