Sounds play in Studio but not on Roblox, despite all assets being approved

I’m recreating the Bloom generative music app and I’m encountering an issue where my sounds are playing in Studio but not on Roblox when published

This is what I’ve tried to attempt to troubleshoot thus far.

  1. Added a print statement that indicates which note was supposed to be played.
  2. The use of ‘’contentProvider:PreloadAsync()’’ to be sure the sounds have loaded.
  3. Made sure all uploaded sounds were approved.

These are the snippets from my client script:

More snippets can be requested

The random sound selection logic inside my circle creation (castCircle) function:

local note = RandNote() -- <The names of the notes are stored in a table and 
--							are indexed from a folder containing the sounds in RepStorage.> 
if note then
	note.Parent = game.SoundService
	note.Volume = vols[note.Name] 
	note:Play()
	print("playing:", note.Name)  -- <On a Roblox game client, notes are being printed, but not played.>

	local Length = note.TimeLength
	local fadeout = TweenInfo.new(Length, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
	local Destination = {Volume = 0}
	local createfade = tweenService:Create(note, fadeOutTweenInfo, fadeOutGoal)
	createfade:Play()
	createfade.Completed:Connect(function()
		note:Destroy()
	end)
else
end

Calling the castCircle function which creates a circle and plays a random note:

local function Interact(input)
	if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
		local mousePos = userInputService:GetMouseLocation() - bg.AbsolutePosition
		castCircle(Vector2.new(mousePos.X, mousePos.Y)) -- <A random sound is played when the 
														--"castCircle" function is called.>
	end
end

Videos comparing the behaviors:

Roblox Studio

Published in Roblox
My volume is turned up to the max, I’m not that foolish.

1 Like

Is the sound in SoundService? If not, try using :PlayLocalSound().

1 Like

Thank you, this method partially solved the problem, but for some reason, it’s not allowing me to interpolate the volume for a fade-away effect using TweenService if I don’t use play().

Try experimenting with this, I think you can find a solution to your problem yourself.

The issue was apparently caused by not allowing enough time for the volumes from my custom volumes table to be applied, leading to the default volume being set to 0. This was not directly related to the use of “play()”, and it seemed that “:PlayLocalSound()” was faster for calculations and initially seemed to resolve the issue, but it did not support fading the sound with tweenservice due to its lack of customization options (which I believe should be changed). I fixed the problem by using “play()” and adding a brief task.wait delay of 0.15 seconds before playing a sound.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.