Jump to content
The Dark Mod Forums

Crazy Idea: Analyzing Ogg Vorbis Sounds


Ishtvan

Recommended Posts

So for sound propagation, a suspicious sound is approximated as an impulse sound (square pulse in 1/60th of a second (1 frame ) ). I'm going to make a "def file" for sounds, so you sound designers will provide a "base volume" and a "frequency band" (the frequency band is very simplified, it will just be one of 6 options I think: very low, low, mid, high, very high and ALL.

 

Then when you play the sound on an entity, you can modify the base values for the sound (for example running on stone is louder than walking on wood, so if the default footstep is walking on wood, multiply the base volume by a multiplier when the player is running on stone).

 

Now, I was thinking: Ogg vorbis sound format is completely open sourced. It would be cool if we could do an analysis of a sound automatically to get the base volume and frequency band numbers.

 

If we did this, frequency band wouldn't have to be so simplified either: it could have the actual Fourier coefficients of the sound when it's decomposed into frequency components in those bands, rather than simple bits (this would take up a little more RAM, but whatever).

 

So basically my crazy idea is: Write a program that takes in a list of Ogg Vorbis sounds. It decodes the sound, calculates some sort of max volume (maybe time averaged around a short time on either side of the peak volume). This is used to generate the "base volume" for the sound prop. impulse sound approximation. (ie, when the sound is propagated to AI, it just has this base volume on a square wave 1/60th of a second long).

 

2nd, the program performs a Fourier transform of the volume vs. time data for the sound, and gets the fourier coefficients for various frequencies. It then puts these into one of our divisions (say we divide the audible frequency spectrum into 8 bands or something like that), and also normalizes all of them such that all the coefficients added up equals 1.

 

Do you sound designers know of a program that does something like this with Ogg Vorbis sounds?

 

I found the Ogg Vorbis SDK here: http://www.vorbis.com/download_win_1.0.1.psp

 

Anyway, if there's an existing program that does something close to this, we might be able to get this in by the first milestone. I'm not going to attempt to write it from scratch though, so if not, you guys might have to deal with putting in by hand, for each suspicious sound, something like: "soundname = footstep_default", "baseVol = 25 dB" and "freq = freq_mid + freq_very_high" or something like that, in a def file.

Link to comment
Share on other sites

It wouldn't run ingame, it would run once to generate your "suspicious sound" def files and "environmental sound" def files. (These are files that determine things like what volume/frequency the sound has according to out sound prop. model). You'd have to run it whenever you put in a new sound as a sound designer, but never during gameplay.

 

Yeah, I'm afraid this isn't something for the first milestone (at least not something I have time for by myself), unless we somehow happen upon a miracle program that already does this.

 

If we have to do it from scratch, there is probably a signal processing library or something for C++ (I can try and ask some of my friends who do signal processing all day). All we really need is a Fourier transform algorithm (people use this all the time so I would imagine it's pretty easy to find) and some way to get a "base volume" that is roughly based on the max volume of the sound, but also takes into account how long the sound is at max volume over a short time range.

Link to comment
Share on other sites

Signal processing should be available for linux. I'm pretty sure I saw something like that in a package description, but I can't really say where as I never was interested in such stuff myself. But there are all kind of sound processing applications, so there is certainly something there.

Gerhard

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 2 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
×
×
  • Create New...