GENSOUND()

Previous topic - Next topic

Hemlos

gensound doesnt seem to increment the index...
however, i can put in my own identifiers and loadsound works fine.
Bing ChatGpt is pretty smart :O

MrTAToad

do you use LOADSOUND using the GENSOUND  value ?

Hemlos

Forgot to GLBAL them woops ...working
Bing ChatGpt is pretty smart :O

Hemlos

#3
Crud, its still not working by globalizing.

Heres the code, and i put results of the 3 generated codes underneath:

Code (glbasic) Select

Music_Smile$ = "media/Sound/Smile.mp3"
Music_Smile = GENSOUND()
Volume[Music_Smile]=0.1
LOADSOUND Music_Smile$, Music_Smile, 2

Music_KeyTest$ = "media/Sound/Key1.wav"
Music_KeyTest = GENSOUND()
Volume[Music_KeyTest]=0.9
LOADSOUND Music_KeyTest$, Music_KeyTest, 2

Music_Click1$ = "media/Sound/Click1.wav"
Music_Click1 = GENSOUND()
Volume[Music_Click1]=0.9
LOADSOUND Music_Click1$, Music_Click1, 1


Music_Smile =0
Music_KeyTest = 0
Music_Click1 = 1

It uses 0 twice for the first two, then increments...thats the bug


If i manually set these params, it works fine:
Music_Smile =0
Music_KeyTest = 1
Music_Click1 = 2
Bing ChatGpt is pretty smart :O

Hemlos

hmmm i think i ERRed...

first one is an mp3...i dont think loadsound loads that :(
Bing ChatGpt is pretty smart :O

Hemlos

kinda sucks because i made volume slider function which uses all sounds index, as an identifier.

so i either 1. have to make a second slider to separate sounds and music, or 2. create a conglomerated indices of sounds and music.


I think im just going to omit the gensound() command altogether and manually enter the index values.
Bing ChatGpt is pretty smart :O

MrTAToad

Sound and Music are treated differently - sounds use WAV's and music MP3/OGG etc etc