Unable To Get Audio Name By Audio ID

I made a music GUI, and I want to show the name of the song ID playing. say im using 12345. Im doing songName.Text = game.MarketplaceService:GetProductInfo(sound.SoundId).Name wich sound is = workspace.music.SoundID. It keeps saying Unable To Cast Instance To Int64. I need help please. Clearer code

local sound = game.Workspace.music

local songName = main:FindFirstChild(“SongName”)

songName.Text = game.MarketplaceService:GetProductInfo(sound.SoundId).Name

You forgot to add the InfoType Enum to :GetProductInfo(). Try this

local marketplaceservice = game:GetService("MarketplaceService")

songName.Text = marketplaceservice:GetProductInfo(sound.SoundId,Enum.InfoType.Asset).Name

It still doesent work and says cant cast to int 64 image

btw is his not working since this is in a local script?

No, it will work in a localscript. Try this instead

local marketplaceservice = game:GetService("MarketplaceService")
local songid = sound.SoundId:match("%d+")

songName.Text = marketplaceservice:GetProductInfo(songid,Enum.InfoType.Asset).Name
2 Likes