AssetService:SearchAudio() returns private audios

  1. What do you want to achieve?
    I want to let players search for audios and play them

  2. What is the issue?
    AssetService:SearchAudio() returns audios that the experience does not have access to.

Example: Searching for “something” returned the audio id 94086596518342

local params = Instance.new("AudioSearchParams")
params.SearchKeyword = "something"
local pages = game:GetService("AssetService"):SearchAudio(params)

local Sound = Instance.new("Sound",workspace)
Sound.SoundId = "rbxassetid://" .. pages:GetCurrentPage()[1].Id

The code throws 2 errors:

  • Failed to load sound rbxassetid://94086596518342: User is not authorized to access Asset.
  • The experience doesn’t have access permission to use asset id 94086596518342. Click to share access

For some reason it does not throw these errors in unpublished experiences.

  1. What solutions have you tried so far?
    I detect whether the audio is private by checking Sound.IsLoaded and notify the player if it takes too long to load.

Now it’s the second result that’s private