Apple Inc. is considering introducing an online service to stream music based on users’ tastes, two people with knowledge of the plans said, potentially competing with Pandora Media Inc.

Apple has held talks with record companies about acquiring the necessary music rights, said the people, who declined to be identified because the talks are private. The discussions are in early stages and haven’t addressed issues such as terms, one person said. The service won’t be part of Apple’s new iPhone introduction next week, they said.