Author Topic: Help with sound file  (Read 3514 times)

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.

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)

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.
« Last Edit: September 09, 2017, 05:22:09 PM by Mr. Dr. Proffesor »

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

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?

« Last Edit: September 09, 2017, 05:44:45 PM by Mr. Dr. Proffesor »

No. Post the add-on please so we can take a look at what's wrong.


all wav files must be mono 16bit. make sure you change the bit in the DAW and also in the export function



According to Google, 1 KB = 8000B
16 bit seems small...
« Last Edit: September 09, 2017, 07:17:20 PM by Mr. Dr. Proffesor »

holy forget i can't believe what im seeing

According to Google, 1 KB = 8000B
16 bit seems small...

just.....export as 16b mono pls

According to Google, 1 KB = 8000B
16 bit seems small...

Please do more research before you say anything more silly about 16bit audio

Ok, I'm sorry for my little knowledge of files, I've done some research. I managed to convert all of the sound to "WAV (Microsoft) signed 16-bit PCM" because that is the only option that has 16 bit in the export tab. I then went to blockland, started a single player server and tried to see if the files worked. They did not. So here is what I've done so far
1. I copied the server.cs and description from Sound_Buttons
2. I changed all of the sound names in the server.cs
3. I changed the description and added the .wav files to the folder
4. I posted here
5. I added .wav to all of the filenames in server.cs
6. I sent the link for the .zip file
7. I changed all of the .wav files to 16bit


« Last Edit: September 10, 2017, 01:23:58 PM by Mr. Dr. Proffesor »