| Blockland Forums > Modification Help |
| Help with sound file |
| (1/5) > >> |
| Mr. Dr. Proffesor:
Hello. I am wondering what is wrong with this code. datablock AudioProfile(Boing) { filename = "./Boing.wav"; description = AudioClosest3d; preload = false; }; datablock AudioProfile(Breathing : Boing) { filename = "./Breathing.wav"; }; datablock AudioProfile(Creepy_Violins : Boing) { filename = "./Creepy_Violins.wav"; }; datablock AudioProfile(Keyboard : Boing) { filename = "./Keyboard.wav"; }; datablock AudioProfile(Trombone : Boing) { filename = "./Trombone"; }; datablock AudioProfile(WEE_WOO : Boing) { filename = "./WEE_WOO"; }; datablock AudioProfile(Welcome_WEE : Boing) { filename = "./Welcome_WEE"; }; I made sure I spelled all of the sound files correctly. |
| Kyuande:
Avoid using generic sound names, add Sound or something at the end of each name. I do not see what's wrong with the code, what are you having trouble with? Sound issues?: Some of your filenames are just the file name, I do not see a .wav, make sure to name them correctly like that or they will never work - Make sure the sounds are mono (use something like audacity) |
| Mr. Dr. Proffesor:
The files appear in the addons select in Custom, and in the playsound event. When you event it (onActivate Self playSound Trombone), it doesn't play the sound. I got the base code from Sound_Beeps, and I just changed the sound names. I will try setting it to mono right now, and what do you mean by generic names? In Sound_Beeps, the sounds are just labeled Beep_EKG, Beep_No etc. |
| Kyuande:
that has more characters, putting a name like "Boing" as just a name is too generic which is bad practice for naming datablocks and objects. Here's what I am saying for those ones without the .wav datablock AudioProfile(Welcome_WEE : Boing) { filename = "./Welcome_WEE"; }; The game reads it as "Add-ons/YourAddOn/Welcome_WEE" which isn't actually a file - so it may not play the sound at all. It needs to be: datablock AudioProfile(Welcome_WEE : Boing) { filename = "./Welcome_WEE.wav"; }; Then the game will read it as: "Add-ons/YourAddOn/Welcome_WEE.wav" which is an existing file which should play the sound |
| Mr. Dr. Proffesor:
Ok, so I fixed all of the filenames to filename = "./Soundname.wav"; and it still has no affect. I also converted all of the sounds to mono. Could the generic names have anything to do with the sounds not working? |
| Navigation |
| Message Index |
| Next page |