unit select / order sound problem

cool3a2

Deity
Joined
Mar 30, 2007
Messages
2,177
For my new mod, I recorded some unit select / order sounds. Bsides of that they could be louder (I was unable to set up the microphones signal properly), they can be played well with mp3 players under Windows. Next, I tried to implement them into my mod, using my Magyar Mods definitions (only correcting the tags names and the paths to the sound files). Once I enter the game and select a unit, it says...
- Could not load file... [followed by a path that seems to be correct, checked it several times] (if <LoadType> is set to STREAMED) or
- Audio System: Could not setup 3D sample with handleId 2 (if <LoadType> is set to DYNAMIC_RES)
What am I doing wrong?
 
well you added them into a folder under Assets/Sounds right?

next you need to set up the sound file to actually work, in the Assets/XML/Audio/ folder, if you have a 2d script edit the 2dscript xml, if 3d script, then edit the 3dscript xml to include your file.

you will then need to add it to the audiodefines.xml file

and finally you will need to add it to your unit or whatever your doing.

happy modding
 
Thanks for your reply. Well, I already did what you suggest - that's what I meant by saying 'using my Magyar Mods definition' (yeah, I should have said that the Magyar Mod already uses unit sunds and that I was thinking about xml definitions). These are my definitions for the new mod (I've censored some parts to keep the content of the mod secret):

Audio3DScripts.xml:
<Script3DSound>
<ScriptID>AS3D_CENSORED_SELECT</ScriptID>
<SoundID>SND_CENSORED_SELECT</SoundID>
<SoundType>GAME_SPEECH</SoundType>
<iMinVolume>100</iMinVolume>
<iMaxVolume>100</iMaxVolume>
<iPitchChangeDown>0</iPitchChangeDown>
<iPitchChangeUp>0</iPitchChangeUp>
<bLooping>0</bLooping>
<iMinTimeDelay>0</iMinTimeDelay>
<iMaxTimeDelay>0</iMaxTimeDelay>
<StartPosition>NONE</StartPosition>
<EndPosition>NONE</EndPosition>
<iMinVelocity>0</iMinVelocity>
<iMaxVelocity>0</iMaxVelocity>
<iMinDistanceFromListener>0</iMinDistanceFromListener>
<iMaxDistanceFromListener>0</iMaxDistanceFromListener>
<iMinDistanceForMaxVolume>500</iMinDistanceForMaxVolume>
<iMaxDistanceForMaxVolume>1000</iMaxDistanceForMaxVolume>
<iMinCutoffDistance>7000</iMinCutoffDistance>
<iMaxCutoffDistance>7000</iMaxCutoffDistance>
<bTaperForSoundtracks>0</bTaperForSoundtracks>
<iLengthOfSound>0</iLengthOfSound>
<fMinDryLevel>1.0</fMinDryLevel>
<fMaxDryLevel>1.0</fMaxDryLevel>
<fMinWetLevel>0.5</fMinWetLevel>
<fMaxWetLevel>0.5</fMaxWetLevel>
<iNotPlayPercent>0</iNotPlayPercent>
</Script3DSound>
<Script3DSound>
<ScriptID>AS3D_CENSORED_ORDER</ScriptID>
<SoundID>SND_CENSORED_ORDER</SoundID>
<SoundType>GAME_SPEECH</SoundType>
<iMinVolume>100</iMinVolume>
<iMaxVolume>100</iMaxVolume>
<iPitchChangeDown>0</iPitchChangeDown>
<iPitchChangeUp>0</iPitchChangeUp>
<bLooping>0</bLooping>
<iMinTimeDelay>0</iMinTimeDelay>
<iMaxTimeDelay>0</iMaxTimeDelay>
<StartPosition>NONE</StartPosition>
<EndPosition>NONE</EndPosition>
<iMinVelocity>0</iMinVelocity>
<iMaxVelocity>0</iMaxVelocity>
<iMinDistanceFromListener>0</iMinDistanceFromListener>
<iMaxDistanceFromListener>0</iMaxDistanceFromListener>
<iMinDistanceForMaxVolume>500</iMinDistanceForMaxVolume>
<iMaxDistanceForMaxVolume>1000</iMaxDistanceForMaxVolume>
<iMinCutoffDistance>7000</iMinCutoffDistance>
<iMaxCutoffDistance>7000</iMaxCutoffDistance>
<bTaperForSoundtracks>0</bTaperForSoundtracks>
<iLengthOfSound>0</iLengthOfSound>
<fMinDryLevel>1.0</fMinDryLevel>
<fMaxDryLevel>1.0</fMaxDryLevel>
<fMinWetLevel>0.5</fMinWetLevel>
<fMaxWetLevel>0.5</fMaxWetLevel>
<iNotPlayPercent>0</iNotPlayPercent>
</Script3DSound>

AudioDefines.xml
<SoundData>
<SoundID>SND_CENSORED_SELECT</SoundID>
<Filename>Sounds/Units/CENSOREDSelect</Filename>
<LoadType>DYNAMIC_RES</LoadType>
<bIsCompressed>1</bIsCompressed>
<bInGeneric>1</bInGeneric>
</SoundData>
<SoundData>
<SoundID>SND_CENSORED_ORDER</SoundID>
<Filename>Sounds/Units/CENSOREDOrder</Filename>
<LoadType>DYNAMIC_RES</LoadType>
<bIsCompressed>1</bIsCompressed>
<bInGeneric>1</bInGeneric>
</SoundData>

I could use Audio2DScripts.xml instead of 3D. But the other unit sounds (from the Magyar Mod) are also in 3D and they are also only mp3s. So why?
 
honestly if some are working and that one isn't I don't know. I have something similar in my mod, in one of the soundtracks, for like a half a second, there is a scratchy sound, but when i listen to it in windows it is fine. All 15 of my other soundtracks play perfectly, and just the one sounds scratchy in the exact same spot every time. Sometimes things are just unexplainable, maybe just try again if its not too much work, since you censor you work I doubt you'd want to upload the mod, but there could be a solution there as well.
 
I believe I found the reason for these problems, but no solution. My own files are in 20 or 22 kHz (I'm to lazy to look it up) and 160kBit/s, the sound files of the Magyar mod are in 44.1kHz and 128kBit/s. Correcting the bitrate is no prob, but each time when I try to get 44.1kHz files, the sounds get played to fast (under Windows). The reason for this seems to be lame - what a poor crap... I already recognized this effect when I tried to record the sounds directly as mp3. To avoid this, I though I record it in wav and convert it afterwards. But converting, no matter with which program I do it, leads to the same result; all of these programs use lame...
 
Now, I managed to get files in the desired specifications, but I hear nothing... Path and filenames should be okay. At least, there are no error messages anymore. No clue what could be wrong now...
 
Now, the error messages appear again. That they didn't for a while, was because I once tried to make these sounds 2D and after taking back my changes, I forgot to correct some tags. Anyways, I got the conversion with lame working, looks like I used an old version before. Still, no successs - I get these error messages. When I use them as wav, sounds play, but the beginning of the wav gets repeated, so it sounds ugly. Not to mention that the wavs are quite big.
Don't know what else I could do. That the wavs work, tells me, that there is no typo in the paths. All the other properties in the xml are copied from the other mod. The mp3s are 44.1kHz and 128Kbit/s, just like the ones from the other mod. On the other side, I've seen that many of the soundtrack files coming with civ4, have different bitrates, so that's probably less crucial... I'm running out of ideas...
 
i have no clue honestly man, I seriously doubt the bit rate has anything to do with it, as I've downloaded and installed all kinds of random mp3 files into mods, and all of them at least play, some have sounded a little scratchy at times, but you hear the music nonetheless.

when you did all the defines, did you copy a similar define.. like for example you copied another unit select/order define, then just changed the name, and where it points to? If you do exactly that I see no reason why it wouldn't at least play, so long as its mp3 format.

I do that in every aspect of modding... If i need to make a new kind of rifleman, i copy the rifleman, not the scout, just as an example. Its best to copy the stuff that most closely matches what your adding, you will for sure have less problems overall.
 
when you did all the defines, did you copy a similar define.. like for example you copied another unit select/order define, then just changed the name, and where it points to? If you do exactly that I see no reason why it wouldn't at least play, so long as its mp3 format.
Jupp, that's what I've done. I reused the definitions from my Magyar Mod in my new mod. But no luck. As said, I even get error messages.
At the moment, I've solved it by using wavs, which are 150 - 250KB - that's not too good, but well. That some of them played two times (or at least parts of the wavs get repeated) has been caused by a converter I used for converting mp3s to wav.
I have no clue what else I could do to make the mp3s working. khan siad, that he never got his own unit select / order sounds to work, if I got him right. I also took a look at the Poland module of ROM as it also uses unit order / select sounds - they use wav, too.

There is only one thing I could imagine is worth a try. Which program and encoder do you use? I did it via cdex and lame 3.98.2 (but used BeSweet for mp3 to wav conversion).
 
you could perhaps ask the guys over at dune wars or some other mega mod.. they have all custom unit order sounds.

or maybe someone else will chime in this thread that knows more about it.
 
Top Bottom