Why does this code work but not the other way Playing Music.

Hey, I was trying to add some game varitables but for some reason one way works but not the other way.

        if self.GameVaritabls[6] != "None":
          self.LogonScreenBackGround = loader.loadSfx("Music\Space_(by_Noriko_Matsueda).ogg")
          self.LogonScreenBackGround.play()
          self.LogonScreenBackGround.setLoopCount(0)
          self.LogonScreenBackGround.setVolume(float(self.GameVaritabls[7]))

This one works but this other one doesnt.

        if self.GameVaritabls[6] != "None":
          self.LogonScreenBackGround = loader.loadSfx(str(self.GameVaritabls[6]))
          self.LogonScreenBackGround.play()
          self.LogonScreenBackGround.setLoopCount(0)
          self.LogonScreenBackGround.setVolume(float(self.GameVaritabls[7]))

:audio(error): createSound(“Music\Space_(by_Noriko_Matsueda).ogg”
): File not found.

O.o;?

I have no idea what’s stored in your variable, but remember that in Panda you should use the forward slash ("/") and not the backslash ("") to separate directory components.

David

I know I tried both ways to check. Um I read a file, put the file lines into a list and then called that list number. Actully that error says whats inside the variable or what I have in there is:

Build06052009
0.596491217613
1
0
800
600
"Music\Space_(by_Noriko_Matsueda).ogg"
0.259892404079

Hmm after thinking about it a little more I for got about the \n that is added at the end when you make a new line.

maybe you shouldnt use the quotes in your file? because there are no quotes in eg. Build06052009, so why should they be in your path?

quote are added automatically is you print out variables so you see those are strings and not something else. btw. what’s the point in reviving an thread for no reason?