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

    • The Black Arrow

      Hope everyone has the blessing of undying motivation for "The Dark Mod 15th Anniversary Contest". Can't wait to see the many magnificent missions you all may have planned. Good luck, with an Ace!
      · 0 replies
    • Ansome

      Finally got my PC back from the shop after my SSD got corrupted a week ago and damaged my motherboard. Scary stuff, but thank goodness it happened right after two months of FM development instead of wiping all my work before I could release it. New SSD, repaired Motherboard and BIOS, and we're ready to start working on my second FM with some added version control in the cloud just to be safe!
      · 4 replies
    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
×
×
  • Create New...