Not long ago, SoundCloud was one of the fastest-growing and most influential players in the streaming business. Now it is shrinking, and faces an uncertain future in the rapidly consolidating online music market.

On Thursday, SoundCloud announced that it was laying off 173 employees, about 40 percent of its work force. The company will also close its offices in London and San Francisco, concentrating its business in Berlin and New York.

“By reducing our costs and continuing our revenue growth, we’re on our path to profitability and in control of SoundCloud’s independent future,” Alexander Ljung, the company’s chief executive and co-founder, wrote in a blog post.

The cuts may have been a defensive move. A fresh wave of speculation has spread through the music industry that SoundCloud may be for sale — at a valuation far lower than the $1 billion it has sought in the past.

A company spokeswoman declined to comment beyond Mr. Ljung’s post.

Founded in Berlin in 2008, SoundCloud was embraced by rappers and up-and-coming musicians around the world as a destination for new tracks that might never appear elsewhere. Its most famous success story is Lorde, who began her career as a teenage SoundCloud user.

By 2014, SoundCloud had become a streaming giant with 175 million regular users, making it one of the most popular music sites in the world. But it also faced pressure from the record labels to sign licensing deals and develop a paid subscription model to compete with Spotify and Apple Music.

The result, SoundCloud Go, arrived early last year, to mixed reviews. SoundCloud has not updated its user numbers in almost three years, but analysts believe that it is far lower than 175 million.

Spotify has 140 million users, 50 million of whom pay for subscriptions, and Apple Music has 27 million paying users. Amazon does not report how many people use its Prime Music service, but by some estimates it is a close competitor to Apple and Spotify.

SoundCloud has valued itself as highly as $1.2 billion, and has had courtships with Twitter and Spotify. But its financial position has grown shakier as it has posted repeated losses. In its latest financial report, filed with British regulators late last year, SoundCloud said that it had enough cash to meet its obligations only through September; in March, the company secured a $70 million line of credit.

SoundCloud has come to symbolize the precarious position of any stand-alone independent in an online music market that Spotify, Apple, YouTube and Amazon have come to dominate.

Pandora Media, once an unassailable leader in internet radio, faced an investor revolt when it tried to expand into new businesses like subscriptions and ticketing. Last month, the company sold a 19 percent stake to Sirius XM for $480 million, and its chief executive and two other top executives left the company.

Jim Griffin, a longtime digital media consultant, said that SoundCloud once occupied “a good place to stand for those with audio needing to reach the world.”

Now, he added, “it is looking for a chair in a savage late round of musical/media chairs.”