Author Topic: adding custom mp3 to quickbattle sfx folder  (Read 3196 times)

Offline JimmyB76

  • Posts: 6423
  • Cookies: 421
adding custom mp3 to quickbattle sfx folder
« on: November 22, 2006, 03:15:53 PM »
something i was curious about...
recently, after talking with CR who successfully did this for fed ships, i managed to "unlock" the sfx files in the quickbattle folder for stock ships...
basically adding shipdefs in the foundation py, and as well changing the related pys in scripts/custom/ships to match...  so now felix will say "Simulated enemy Akira class has been destroyed" or "Simulated friendly Sovereign class has been destroyed" and so forth, using the stock fed ships in qb...
so i took it one step further, and made shipdefs, in the foundation py, for the rest of the stock ships, and now felix will say "Simulated enemy Klingon Vorcha has been destroyed" or "Simulated friendly Romulan Warbird has been destroyed"...  it all works fine, and it's nice to hear something other than the generic line...
example
Code: [Select]

class WarbirdDef(ShipDef):
def __init__(self, abbrev, species, dict):
ShipDef.__init__(self, abbrev, species, dict)
def StrFriendlyDestroyed(self):
return 'QBFriendlyWarbirdDestroyed'
def StrEnemyDestroyed(self):
return 'QBEnemyWarbirdDestroyed'

so i wanted to take it a step further, and see if i can add a custom mp3 to the sfx/quickbattle menu, and apply it to the already-existing shipdefs...
i spliced and edited together 2 existing sfx files into an mp3 so that felix would say "Simulated enemy Cardassain ship has been destroyed" (encoded it with winlame), and figured i would add it to the CardShipDef and it should be ok...  
if i use one of the files that is there already (like QBEnemyGalorDestoyed) and add it to the CardSHipDef, it works on all my cardassian ships...  (felix would say "Simulated enemy Cardassian Galor has been destroyed" no matter the card ship)...  
this is where i am stuck lol
if i try to use a custom mp3 in the quickbattle menu and apply it to the shipdef in the foundation py, it doesnt want to work...  no crash, no bsod, nothing in the console... felix just doesnt say anything, and the subtitle flashes for a split second (too fast to read)...
somehow, it seems this should work...
is there something i'm missing?

Offline El

  • Master Hardpointer
  • Retired Administrator
  • Posts: 653
  • Cookies: 123
  • Former Vice Admin
adding custom mp3 to quickbattle sfx folder
« Reply #1 on: November 22, 2006, 05:25:04 PM »
Yep, it's to do with how you encoded your mp3. BC is very picky.

I can't remember the settings, but if you use something like GSpot to analyse a stock mp3, and make sure you encode to the same in winlame.

Should work..

Offline JimmyB76

  • Posts: 6423
  • Cookies: 421
adding custom mp3 to quickbattle sfx folder
« Reply #2 on: November 22, 2006, 07:55:08 PM »
hmmm ok one step closer...  
so i made a back up of my current QBEnemyKeldonDestroyed sfx file (using the Keldon to test), and renamed my "QBEnemyCardassianDestroyed" to say " ...  KeldonDestroyed" etc etc, and tried QB against a Keldon, and felix said my custom file "Simulated enemy Cardassian Ship has been destroyed" as it should, tho the subtitle said "Cardassian Keldon"...
is it a TGL thing?  this seems like such an easy thing im overlooking...  i could care less about subtitles, just being able to hear this whenever i destroy any of my cardassian ships, since they all use the CardShipDef (except now, for my install, the galor keldon and hybrid have their own defs) lol
i just downloaded and installed GSpot, and am trying to learn its aspects now...

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
adding custom mp3 to quickbattle sfx folder
« Reply #3 on: November 23, 2006, 03:21:26 AM »
You must not forget to make the mp3 known to BC.

This is done through SoundDef's.


Also, all stock ship definitions can be found in StaticDef.py so they can be changed.

I think that there may be a slightly easier way, than to create classes for every ship.

But I don't have the Foundation files here. :(
So I can't check.


It's a bit early, so I'm not entirely clear, I think. :oops:
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline El

  • Master Hardpointer
  • Retired Administrator
  • Posts: 653
  • Cookies: 123
  • Former Vice Admin
adding custom mp3 to quickbattle sfx folder
« Reply #4 on: November 23, 2006, 07:52:10 AM »
Quote from: JimmyB76

i just downloaded and installed GSpot, and am trying to learn its aspects now...


Just open GSpot and drag your mp3 to it. It should then show all the encoding details you need: Bit rate (don't use variable bit rate it wont work), Joint Stereo (should be ok)... etc

Offline JimmyB76

  • Posts: 6423
  • Cookies: 421
adding custom mp3 to quickbattle sfx folder
« Reply #5 on: November 23, 2006, 08:09:28 AM »
Quote from: MLeo

This is done through SoundDef's.

hmm ok that does make sense, i havent done that i think...  how would i go about being sure of that?
also, should i write up a TGL for it; adding a string in the quickbattle tgl?
Quote from: MLeo

Also, all stock ship definitions can be found in StaticDef.py so they can be changed.
I think that there may be a slightly easier way, than to create classes for every ship.

ya the stock ships are in StaticDef, but not the general CardShipDef...  ultimately i am trying to see if i can get Felix to say "Simulated enemy Cardassian ship has been destroyed" whenever i play against any of the card ships (except of course the galor keldon and hybrid, as they all have their own sfx files from the quickbattle folder)...  should i write up a CardShipDef in the Static Def py?  
i assumed that just having it be like this in the foundation py:
Code: [Select]

class CardShipDef(ShipDef):
def __init__(self, abbrev, species, dict):
dict['race'] = Cardassian
ShipDef.__init__(self, abbrev, species, dict)
def StrFriendlyDestroyed(self):
return 'QBFriendlyCardassianDestroyed'
def StrEnemyDestroyed(self):
return 'QBEnemyCardassianDestroyed'

it seems it should work...  tho i havent yet put together a sound file to have felix say "Simulated friendly Cardassian ship has been destroyed"  cuz im hoping the Enemy one will work first lol
Quote from: Elminster

Just open GSpot and drag your mp3 to it. It should then show all the encoding details you need: Bit rate (don't use variable bit rate it wont work), Joint Stereo (should be ok)... etc

okee i think i understand now :)  
it shows any random stock mp3 as 44100Hz  64 kb/s , Monophonic and my custom mp3 as 44100Hz  88 kb/s tot , Joint Stereo LAME3.97b
not too sure what all that means tho lol  i have used winlame to encode other various mp3's (ive done alot of altering, for example, to brex's sound fx files in bridge/crew/engineering, adding computer sounds to certain things he calls out as the ship takes on damage and such - and they all work fine ingame)...

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
adding custom mp3 to quickbattle sfx folder
« Reply #6 on: November 23, 2006, 08:17:28 AM »
Quote from: JimmyB76
Quote from: MLeo

This is done through SoundDef's.

hmm ok that does make sense, i havent done that i think...  how would i go about being sure of that?
also, should i write up a TGL for it; adding a string in the quickbattle tgl?
Quote from: MLeo

Also, all stock ship definitions can be found in StaticDef.py so they can be changed.
I think that there may be a slightly easier way, than to create classes for every ship.

ya the stock ships are in StaticDef, but not the general CardShipDef...  ultimately i am trying to see if i can get Felix to say "Simulated enemy Cardassian ship has been destroyed" whenever i play against any of the card ships...  should i write up a CardShipDef in the Static Def py?  i assumed that just having it be like this in the foundation py:
Code: [Select]

class CardShipDef(ShipDef):
def __init__(self, abbrev, species, dict):
dict['race'] = Cardassian
ShipDef.__init__(self, abbrev, species, dict)
def StrFriendlyDestroyed(self):
return 'QBFriendlyCardassianDestroyed'
def StrEnemyDestroyed(self):
return 'QBEnemyCardassianDestroyed'

it seems it should work...  tho i havent yet put together a sound file to have felix say "Simulated friendly Cardassian ship has been destroyed"  cuz im hoping the Enemy one will work first lol

Yes, that works, but it's because there is a sound registerd to the name 'QBEnemyCardassianDestroyed'.

Search StaticDef.py (I think) for SoundDef and you will see how it's done.


I think the best idea is to offset the changes to an external file.
I'm thinking a 001-Addon20061123-JimmyStrDestroyed.py file in scripts/Custom/Autoload/.

It would set the "default" for all (normal) static defs, and overwrite it for the stock ships.

I'll think of a way to do this easier for future reference.;)
Shouldn't take too long, so maybe I'll have something tonight (local time).
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline JimmyB76

  • Posts: 6423
  • Cookies: 421
adding custom mp3 to quickbattle sfx folder
« Reply #7 on: November 23, 2006, 10:18:13 AM »
i havent had much luck trying to create a py in autoload for this...
i'm not entirely sure what to put in it lol
following the sound defs in the staticdef py, im thinking
Code: [Select]

Foundation.SoundDef("sfx/Quickbattle/QBEnemyCardassianDestroyed", "Cardassian Destroyed", 1.0, { 'modes': [ Foundation.MutatorDef.StockSounds ] } )

should work?
lol my noobness is shining brightly it seems

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
adding custom mp3 to quickbattle sfx folder
« Reply #8 on: November 23, 2006, 10:26:38 AM »
You forgot to add .mp3 (or .wav) at the end of the filename.


If you can come online (on MSN) and send me the Foundation files, I might be able to do something now.
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline El

  • Master Hardpointer
  • Retired Administrator
  • Posts: 653
  • Cookies: 123
  • Former Vice Admin
adding custom mp3 to quickbattle sfx folder
« Reply #9 on: November 23, 2006, 01:30:39 PM »
Quote from: JimmyB76

Quote from: Elminster

Just open GSpot and drag your mp3 to it. It should then show all the encoding details you need: Bit rate (don't use variable bit rate it wont work), Joint Stereo (should be ok)... etc

okee i think i understand now :)  
it shows any random stock mp3 as 44100Hz  64 kb/s , Monophonic and my custom mp3 as 44100Hz  88 kb/s tot , Joint Stereo LAME3.97b
not too sure what all that means tho lol  i have used winlame to encode other various mp3's (ive done alot of altering, for example, to brex's sound fx files in bridge/crew/engineering, adding computer sounds to certain things he calls out as the ship takes on damage and such - and they all work fine ingame)...


Looks like its your bitrate thats the problem. Set it to 64kbs and make sure its fixed. Joint stereo should be ok, but it may be worth trying monomorphic.

Offline CaptainRussell

  • Posts: 166
  • Cookies: 25
adding custom mp3 to quickbattle sfx folder
« Reply #10 on: November 23, 2006, 08:14:07 PM »
Bear in mind that you also have to generate a special file in the QB sound folder for each new sound that you add - I can't remember the file extension (is it LPT?) but you'll see these files if you open the QB sound folder - they'll have some of the same names as the MP3s that are in the same folder.  You probably have to generate a file of this type to go along with any new sound files that you make for your dying QB ships.

-CR

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
adding custom mp3 to quickbattle sfx folder
« Reply #11 on: November 24, 2006, 02:45:43 AM »
Quote from: CaptainRussell
Bear in mind that you also have to generate a special file in the QB sound folder for each new sound that you add - I can't remember the file extension (is it LPT?) but you'll see these files if you open the QB sound folder - they'll have some of the same names as the MP3s that are in the same folder.  You probably have to generate a file of this type to go along with any new sound files that you make for your dying QB ships.

-CR

Wasn't LPT not the file that describes the mouth animation cycle?

Anyway, it's in the documentation of the SDK.
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline JimmyB76

  • Posts: 6423
  • Cookies: 421
adding custom mp3 to quickbattle sfx folder
« Reply #12 on: November 24, 2006, 07:32:02 AM »
ya, those .LIP files are about mouth animations...  and alot of the sfx files in the quickbattle folder don't have .LIP files yet seem to work ok without them...  tho, the ones without the .LIP, i havent tried to see if felix's mouth actually moves when the line is being said...  even if if doesn't, felix generally has his back to you, so it's not a big deal to me, personally...

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
adding custom mp3 to quickbattle sfx folder
« Reply #13 on: November 24, 2006, 07:41:18 AM »
I just rememberd, the TGL is important to some respect, it supplies the text, it may also provide the mp3 location.

But I don't think this is documented anywhere.
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline JimmyB76

  • Posts: 6423
  • Cookies: 421
adding custom mp3 to quickbattle sfx folder
« Reply #14 on: November 24, 2006, 11:34:47 AM »
in fact it does...  that's why i was thinking it might have been a TGL thing...  i'll add the string and see how it goes...

Offline JimmyB76

  • Posts: 6423
  • Cookies: 421
adding custom mp3 to quickbattle sfx folder
« Reply #15 on: November 24, 2006, 12:02:20 PM »
Success!  i knew this whole drama boiled down to one slight thing lol...  all it needed was adding a string to the TGL, i had done everything correctly, that was just the one block...  ugh - i dont even know why ive been so obsessed with this...
ah well, learn something new every day, i suppose...one step closer to graduating from noobness lol
thank you guys very much for walking thru this with me - much obliged sincerely :)

Offline CaptainRussell

  • Posts: 166
  • Cookies: 25
adding custom mp3 to quickbattle sfx folder
« Reply #16 on: November 25, 2006, 08:24:31 PM »
What program did you use to edit the TGLs and where did you get it? :?:

Offline JimmyB76

  • Posts: 6423
  • Cookies: 421
adding custom mp3 to quickbattle sfx folder
« Reply #17 on: November 25, 2006, 11:43:38 PM »

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
adding custom mp3 to quickbattle sfx folder
« Reply #18 on: November 26, 2006, 05:44:53 AM »
I would like to note that one should try and keep the number of tgl changes to a minimum, they aren't very modular. :(
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline CaptainRussell

  • Posts: 166
  • Cookies: 25
Re: adding custom mp3 to quickbattle sfx folder
« Reply #19 on: November 30, 2006, 04:36:01 PM »