Chatbot Music Player - ROBLOX Audio Catalogue Scraper bot Instance.new("AudioSearchParams")

It’s designed to query with the Audio Search Params which returns pages of data which each contain details about the asset such as asset id which is written to a sound object and played. So no i do not think so.

for what it does play, does it cache the sound data and then play it, or is it getting the sound data and playing it at the same time? I am interested in what you where saying how this can help with the performance of loading and playing music.

It gets the entire page of data when playing a playlist, it plays a track
then it waits for the track to complete then destroys the audio instance, before creating the next track in order unless it’s called to stop or a new playlist is being played.

nice , is it able to do crossfading from one song to the next?

This is very nice.

But you could add something like, an option so the music loops and an option to control the minimum duration that the music sound has to be.
These are just recomendations of what would make this module better, but it is already very good.

Badges don’t accurately represent somebodies experience with development. A new user on the devforum could be a programmer of 7 years, or a UI designer for a month. An existing user that’s been on for 2 years may only have been a programmer for 1 year.

It’s good that you have those badges. You should still consider people’s feedback, even if they have less badges than you.

Besides, this topic didn’t actually get 50 likes, it got 2.


Let me add my own feedback to the mix!

You should use task.spawn! spawn internally uses wait, which I know you do not like because you opted for task.wait.

Setting this property will always be successful, so you do not need a pcall here. It will show a Failed to load sound data error for invalid SoundIds, but it’s not going to stop your script.

Use if internalstop then! It will work the same, and it is more readable.

This is a bit icky. We could make it better by instead using audio.Ended:Wait(). When internalstop is set to true, you should also find a way to stop the current audio playing. Maybe by saving it to an internalaudio variable? It would also act as a reusable audio object so you don’t need to create new ones per song. Just make sure to reset the TimePosition when you set the next song.

Use if not audiotype then here! It works the same and it’s more readable.

You can shorten this line by using internalstop = (audiotype:lower():find("stop") or query:lower():find("stop")) and true or false!

Adios? Personally I don’t know how to make this work with multiple languages without just making a huge list of all variations of “bye” in all languages.

That’s nice if you’re interested in editing the code have at it.!
Also the internal for the audio playlist

for i=1, incre do 
				task.wait(tonumber(page.Duration/incre))
				if internalstop	==true then
					break
				end	
			end

" This is a bit icky. We could make it better by instead using audio.Ended:Wait() . When internalstop is set to true, you should also find a way to stop the current audio playing. Maybe by saving it to an internalaudio variable? It would also act as a reusable audio object so you don’t need to create new ones per song. Just make sure to reset the TimePosition when you set the next song."
opinions are cool but also this is set-up like this to use the internalloop variable to stop the playlist.

The Eliza architecture was not written by me and was created in 1977.

Also you can use roblox real-time text translation for you experience with this.
“Besides, this topic didn’t actually get 50 likes, it got 2.”
That cute that you pointed that out.
" You should use task.spawn ! spawn internally uses wait , which I know you do not like because you opted for task.wait ."
IT actually doesn’t matter for the functionality of the code, but thanks for the feedback!

pcall(function()audio.SoundId="rbxassetid://"..page.Id end)

Yeah I think that’s an artifact from developing the original code, from trying to :LoadAsset(page.Id).

Also you would not want to reuse the same Audio track, that would just cause potential issues if you wanted to insert a transition it would be very limited using only one track.

Thanks for the feedback! Although I wouldn’t recommend providing feedback to just provide feedback. Seems liek you were trying to pick this apart and found minimal things to mention.
If you’re really interested than just code something.

Original Eliza compares a single key to get a response, I upgraded the architecture to be able to use a table of samples and execute a function on resolution.

["song"] = {{"Perhaps you would like to be able to"},{" play a song", " play some music", " play a track"},function(query) 
			local audioargs={
				query=query,
				audiotype="Music",
				playlist=false,
			}

Also the post only got 2 likes cause I roasted the first guy for being a bot who always posts snarky comments on peoples post without providing real feedback or having any credentials himself.

Oh, this is true. It would be impossible to transition with one audio object.

I mainly only go by the substance of the topic, and not the likes. So that’s okay! It seems like a good resource, but I haven’t fully read it yet.

the model got 13 takes and the other link got 11. Overall I don’t care. You can look for the substance of this post and you will find no other documentation of using AudioSearch Parameters .
I posted this because their are no examples of using the audio search instance in roblox.

Not the AI on ROBLOX’s assistant for the documentation can write this

	local searchParams = Instance.new("AudioSearchParams")
	searchParams.SearchKeyword = query
	if audiotype==nil then 
		audiotype="music"
	end

AudioSearchParams | Documentation - Roblox Creator Hub

It’s really not that important I just wanted to share it. IT is a good architecture for an action based chatbot.
When I was researching this there was no examples anywhere and I had to do a lot of trial and error to figure out the proper methods

1 Like

Updated the title of this topic to be more informative. :slight_smile: