Home   Help Search Login Register  

Author Topic: Cannot find sound...  (Read 2764 times)

0 Members and 3 Guests are viewing this topic.

Offline bigdave003

  • Members
  • *
  • I'm a double bacon genius burger!!
Cannot find sound...
« on: 11 Jan 2006, 23:11:33 »
Hello, im making my first mission using sounds to accompany my radio messages, and im having problems. I cant spot what I've done wrong. My description.ext says:

Code: [Select]
class CfgSounds
{
      sounds[] =
         {
            radio1p
         };
   
      class speech1
   
      {
            name = "radio1p";
            sound[] = {"radio1p.ogg", 1, 1.0};
            titles[] = {   };
      };
};

I'm trying to call the sound in a script using:

Code: [Select]
_man1 = _this select 0
_sound = _this select 1

playSound _sound

and the "on activation" line of my trigger says:

Code: [Select]
[man1,"radio1p"] exec "radio1.sqs"
The script executes but i get an error saying "cannot find sound radio1p". Can someone spot where ive gone wrong?
"From this day to the ending of the world we in it shall be remembered. We lucky few, we band of brothers. For he who today sheds his blood with me shall be my brother. "

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re:Cannot find sound...
« Reply #1 on: 11 Jan 2006, 23:19:00 »
I do believe the sound should be in quotes:

playSound "soundname"
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Offline 456820

  • Contributing Member
  • **
Re:Cannot find sound...
« Reply #2 on: 11 Jan 2006, 23:20:38 »
well all looks fine to me so try my little way of fixing this
in your .ext file where the cfgSounds are located move it to the very top of the description.ext or if they are already at the top move them to the bottom sounds strange but it does work aslong as everything else is right

It sounds weird but has fixed cannot load such and such error messages have a go unless there is something else you are doing wrong i have missed

I persume you have your folder called Sounds with your .ogg file in it saved at the right format

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Cannot find sound...
« Reply #3 on: 11 Jan 2006, 23:23:41 »
Is your sound file in a folder called sounds within your mission folder?

I think if it isn't the game looks for the sound in the Sounds.pbo and fails to find it.

Maybe.


Planck
I know a little about a lot, and a lot about a little.

Offline bigdave003

  • Members
  • *
  • I'm a double bacon genius burger!!
Re:Cannot find sound...
« Reply #4 on: 11 Jan 2006, 23:48:53 »
The file is "\sounds\radio1p.ogg", ive tried changing my description.ext to:

Code: [Select]
class CfgSounds
{
      sounds[] =
         {
            radio1p
         };
   
      class speech1
   
      {
            name = "radio1p";
            sound[] = {"\sounds\radio1p.ogg", 1, 1.0};
            titles[] = {   };
      };
};

But still no joy, even when i just try

Code: [Select]
playSound "radio1p"
in the activation field of the trigger. However, If i try to add it as an effect of a trigger, i get an error saying 'cannot find sound "\sounds\radio1p.ogg"', then plays the sound. I also tried 456820's method with no joy. I dont have a clue where I'm going wrong  ???
"From this day to the ending of the world we in it shall be remembered. We lucky few, we band of brothers. For he who today sheds his blood with me shall be my brother. "

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Cannot find sound...
« Reply #5 on: 12 Jan 2006, 00:07:53 »
Try instead:

man1 say "radio1p"


Planck
I know a little about a lot, and a lot about a little.

Offline Pilot

  • Contributing Member
  • **
Re:Cannot find sound...
« Reply #6 on: 12 Jan 2006, 00:21:32 »
Shouldn't it be:
playsound "speech1"
or
man1 say "speech1"
?

I thought the name field was the name of the sound if you wanted to play the sound from a trigger.  I thought the class name was to be used for scripting commands.

-Pilot

« Last Edit: 12 Jan 2006, 00:22:00 by Pilot »

Offline bigdave003

  • Members
  • *
  • I'm a double bacon genius burger!!
Re:Cannot find sound...
« Reply #7 on: 12 Jan 2006, 00:22:46 »
Sorry Planck, still no joy. It still says that it can't find the file. I can play the sound as an effect on the trigger with no error messages now, but the playSound command still says it cant find it.

Dave
"From this day to the ending of the world we in it shall be remembered. We lucky few, we band of brothers. For he who today sheds his blood with me shall be my brother. "

Offline Trapper

  • Honoured Contributor
  • ***
  • I'm a llama!
Re:Cannot find sound...
« Reply #8 on: 12 Jan 2006, 00:22:51 »
Maybe I'm wrong but let's try. :)

1. The File has to be in the folder \sound, not \sounds.

2. Description should look like this. I've no idea what first part before should be good for.
Code: [Select]
class CfgSounds
{
     class speech1
     {
            name = "radio1p";
            sound[] = {"radio1p.ogg", db0, 1.0};
            titles[] = {  };
     };
};
3. And in the mission call for speech1, that's the class you defined. radio1p is only the name which is displayed in the trigger effects menu and can also remain empty.

Code: [Select]
playsound "speech1"
« Last Edit: 12 Jan 2006, 00:23:57 by Trapper »

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Cannot find sound...
« Reply #9 on: 12 Jan 2006, 00:37:08 »
Yes, ummm......I meant sound, although it shouldn't matter as it should still find it even if you call it treacle I think.........it's only a path after all.   ::)

radio1p is also the name of the .ogg file.


Planck
I know a little about a lot, and a lot about a little.

Offline bigdave003

  • Members
  • *
  • I'm a double bacon genius burger!!
Re:Cannot find sound...
« Reply #10 on: 12 Jan 2006, 00:37:38 »
Bingo!!!! Nice one trapper, works fine now! Problem solved!
"From this day to the ending of the world we in it shall be remembered. We lucky few, we band of brothers. For he who today sheds his blood with me shall be my brother. "

Offline Trapper

  • Honoured Contributor
  • ***
  • I'm a llama!
Re:Cannot find sound...
« Reply #11 on: 12 Jan 2006, 01:54:37 »
Yes, ummm......I meant sound, although it shouldn't matter as it should still find it even if you call it treacle I think.........it's only a path after all.   ::)

Well I'm not sure about this. With a closer look you'll notice I'm not using any path for the CfgSounds in the description and the .ogg will only be found when it is in \sound. This seems to be an important part of sound implantation.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Cannot find sound...
« Reply #12 on: 12 Jan 2006, 02:43:54 »
You are correct Trapper, I just spent an hour playing about with this and it seems you need to have the folder sound in there.......with your sound files in it.

I have yet to try naming the folder to treacle.........I'll let you know.   ::)

EDIT:

Ok, here is what I find.

If you have the sound file without a folder in the path like so:
Code: [Select]
sound[] = {"radio1p.ogg", db0, 1.0};

Then the game looks for the file in Sound.pbo UNLESS you have a folder called sound inside your mission folder.
In which case it will look in there.

If you specify the sound file with a folder in the path like so:
Code: [Select]
sound[] = {"\treacle\radio1p.ogg", db0, 1.0};

Then the game will look for the sound file in the specified folder.....in this case I used treacle.

Nobody, except me possibly, is going to use treacle as a folder name to hold sound files, but you don't need to use 'sound' either.

When using 'playSound' OR 'say' you MUST use the classname that the sound was given in the description.ext.....in this case it was "speech1"



Planck
« Last Edit: 12 Jan 2006, 03:14:42 by Planck »
I know a little about a lot, and a lot about a little.

Offline RichUK

  • OFPEC Patron
  • ****
  • Have fun!
Re:Cannot find sound...
« Reply #13 on: 12 Jan 2006, 09:11:18 »
Just thought I would add to the sound info above...  I am using a LOT of sounds in my Scuds Galore! mission, and here is an extract of some of the stuff from my description.ext.

You will see that:

1. Some files are in the sound sub-directory and although (as you have found) you do not have to use a path for a sound file when it is in there, if you do anyway, as I have done, it will still work OK.

2.  Most of my sounds are actually in sub-sub-directories, in fact some are not really my sounds at all for example I am using Vektorboson's execellent satellite script package. as modified by Blanco (V2.21).

3.  Some sounds are wss and others ogg format. I have experimented with both, and they both have their place.


Code: [Select]
class CfgSounds
{
   sounds[] =
          {shhh,ggv01,ggv02,ggv03,36v01,36v02,36v03,beepstat,burp,mortar1,ruch,cannon1,click,
render,satmove,no,satdeactiv,satactiv,bip,coords,inpos,activate,rendering,stopt,tr_human,tr_f_tank,
tr_f_car,tr_f_ship,tr_f_plane,tr_f_heli,tr_f_car,tr_h_tank,tr_h_ship,tr_h_heli,tr_h_plane,tr_h_car,satab,
tr_e_car,tr_e_plane,tr_e_heli,tr_e_tank,tr_e_ship,keybutton,codefound,wrongcode,close_end,gatemoan,
open_end,s1click,s2coords,s3plnch,s4lnch,s5onwy,s6hits,s7dir,s8abort,s9tooclose,s10toofar};

        class say_shhh
        {
           name = "shhh";
           sound[] = {"\sound\shhh.ogg", db+0,1};
           titles[] = { };
        };
.
. <- dots are not there, just showing stuff skipped from this example extract!

.
   class satactiv
   {
      name = "satactiv";
      sound[] = {"\satellite\SATsound\satactiv.wss", db-0, 1.0};
      titles[] = {  };
   };
.
. <- dots are not there, just showing stuff skipped from this example extract!
.

        class s9tooclose
        {
           name = "s9tooclose";
           sound[] = {"\userscud\SCUDsound\s9tooclose.ogg",db+20,1.0};
           titles[] = {};
        };


There are some other things that I have found, mostly by "trial and error".  I had a problem where I had wave file that played perfectly, and it played perfectly as an ogg file - after converting it in Audacity (an excellenct freeware audio package); the problem was, I could not get OFP to play it, although others of the same type, converted at the same time, played perfectly (and there were no error messages - just no sound!).

I eventually realized what the problem was, OFP does not seem to like ogg sound files with too short a filename (!)

I had been trying to abbreviate the filenames, as I had so many in the sounds[] = definition, that I was concerned that the string length might cause problems, but my good intentions had actually introduced another problem!

Although I have not tested this thoroughly, and it is a little while since I was working on the sound files, I think that the problem occurred when I used a filename less that 4 characters (dot ogg), although this did not seem to be a problem with a wss file ... (like the ones that you can see above like "no" and "bib" which are both wss files!).

I also play the sounds in a variety of ways, including:

Example1
------------
Code: [Select]
_scudLauncher say "s7dir"...object saying something

Example2
------------
Code: [Select]
;play radio stuff
["beepstat", 4] exec "sound_loop.sqs"
...calling a sound loop script that I wrote. to repeat the sound name passed in the number of times passed in, where there sound is actually played with:

Code: [Select]
playSound _sound... as well as normal people saying stuff

I hope that this might help somone...
« Last Edit: 12 Jan 2006, 09:37:05 by RichUK »

Offline Trapper

  • Honoured Contributor
  • ***
  • I'm a llama!
Re:Cannot find sound...
« Reply #14 on: 12 Jan 2006, 12:56:00 »
Very interesting.
So now that I know the use of the first sounds[] = part in front of all classes, can someone explain why my mission still works without problems when my CfgSounds comes without this summary?