I mean, you could at least give details about how to set it up, and some examples of you using it.
Step 1
Insert the DJ Eliza module into the game.
-
require the module in a local script.
-
Pass a variable of Player and this
function(query)
local audioargs={
query=query,--this is a string
audiotype="Music",--Music or SoundEffect
playlist=false,--play one track or multiple tracks
}
cm.Music(audioargs,player)
end
This example skips the easy setup of using a strring to query the eliza algorithm.
I did code it so it places the audio track inside the player.PlayerGui and cleans it up when its over. So that could be improved and would’ve been a great input.
The Eliza chatbot was meant to make it simpler to use
But it can also be used like this.
Originally I made this for a AI plugin where ChatGPT uses this function so I designed it like this intentionally.
Thank you! Now people will know 100% how to use this!
This is the kind of thing that should be in Resource post’s like this!
Most of the stuff are one line without any space or is better done with multiline
I agree with @PhoenixRessusection, The OP doesn’t even know how to handle suggestions and criticism, and he even assumes that they hurt his feelings
The Devforums aren’t only for scripts and code, that’s only one part of game creation. To be honest, your first mistake was replying so defensively to feedback.
Your resource is really interesting and the concept is nice, also it not being another entire machine learning model is refreshing to see. You should expect criticism on topics though.
I write a lot of code and do not always get to share it with others.
I was disagreeing with his criticism. He wants to come at me with weak arguments then he can get promptly explained to why I disagree. He spams the forum with low effort comments and negativity.
If he was a real one he could contribute with a modification instead being the first one to comment and provide negativity while providing nothing to the conversation but a snearing one liner and he can go take himself elsewhere.
I use all of the code I post on the forums in my own projects.
Porting them for public viewing is not something I set hours aside for.
My coding style is functional with non cryptic names of what a function does. This is the better way of coding and spamming comments isn’t always necessary. I do include comments in some things when it is especially cryptic. Although I am not perfect in leaving comments. I am an exceptional coder. I know this from overcoming every coding obstacle I’ve ever done. But I’m not going to go back and modify my code with comments because you asked. I have a lot of other things to do.
Although I do agree the Eliza algorithm is a bit hard to interpret but it’s not my job to go through it and comment every line. It was written in 1977. I ported the code to Luau that was what i did. The music player Eliza is built off the Eliza architecture.
I built it into a function driven text processor where it can take in input and do a function based off sample inputs.
If you cannot comprehend that then you’re going to have a hard time learning to code you should be able to understand logic in a function. @VSCPlays
Hi,
On an happy note thanks for sharing this.
How about a gui / ui with a scrollable menu of music themes, and then also one for a check box that can be used to read song IDs from a folder / table and perhaps a folder with sound property objects… then maybe bonus 2.,0, a volume controller , and toggle on off for the background music!
Also is this only heard by the client?
Thanks u rock!
I agree with you but making an excuse to flex your “status” was really unneeded in this situation.
Yes this is actually one of the features of the plugin I created recently. i haven’t made an interface for this. But if you wanted to make one that would be cool. =] That’s what stuff like this is for to inspire others to create stuff!
It does have a stop function as in if you send a query of stop to the music function it stops the track.
If you set the playlist to true it plays a playlist until you send a query of “stop” or you send another query.
Yes this is only heard by the player. Current it requires a player object cause I had it set up to place the track object inside the player gui.
Also on a single track it returns the audio description. you could modify it to return the audio object. Don’t be afraid to dig into it and do some testing.
@James
I did that to portray/expose the kind of person he is.
@Lord_BradyRocks
I don’t really have the energy or desire to do that right now maybe in the future. Currently it is as is. But I would reccomend using it. I had just deleted all the music tracks in my game which were slowing down join times. This system very efficiently grabs one track at a time and plays it, then destroys it.
But I admit it is ripe for expanding upon the idea. But realistically we also have the toolbox for scraping audio for games
Ok. But are you able to control the tracks that it plays to specific IDs?
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
Updated the title of this topic to be more informative.