How do i get the username of the creator of a sound on roblox via script

hello how do i do this in a script? im trying to make a text label that says the artists name. thanks

couldnt find anything here so im asking
https://developer.roblox.com/en-us/api-reference/class/Sound

Do you have the sound’s ID? If so, you can use MarketplaceService:GetProductInfo, this func returns a table with info about the asset, the info you’d want is the creator info:

https://developer.roblox.com/en-us/api-reference/function/MarketplaceService/GetProductInfo

local marketplace = game:GetService("MarketplaceService")

local function getArtistName(soundId)
	local success, result = pcall(function()
		return marketplace:GetProductInfo(soundId)
	end)
	
	if success then
		if result then
			if result.AssetTypeId == 3 then --Verify that asset is an audio.
				return result.Creator.Name
			end
		end
	else
		warn(result)
	end
end

local artistName = getArtistName(12221967)
print(artistName) --Roblox

Here you go, I tested it by plugging in the ID of an audio asset uploaded by Roblox.

1 Like