JF https://www.javantea.com/page/make/327

I am in the zone. I'm happy because Hack Mars is coming together quickly. Sound has been implemented. The colony structure (as seen yesterday) is finished. The hab is 50% done. Customizing each part of the colony and adding custom structures is a task I will enjoy. I'm listening to my audio collection in random order. Nirvana, Matchbox 20, David Bowie, Bjork, Third Eye Blind, and The Pillows in a row. Absolutely. I have such a large audio collection that it can last days, but it's not so large that it fills a raid array or nothing. I have such a variety that I can pick a genre and randomize, then change genre, randomize, add genre, randomize, add genre, randomize, clear, add two opposing genres, randomize. My audio collection really complements itself. And it supplements me while in my zone.

I have finally allowed my rants to catch up with me. You see, I was ahead by a few days while my server was down. Being ahead is not very cool in my opinion. I wrote my system (in PHP) to handle making daily pages and it works. But getting ahead wasn't planned. Heh heh. So I've had to manually edit three files every day (latestr.html, latestm.html, and latestmlo.html) to give the correct number instead of the most recent number.

I have found one interesting hang up in my audio. I thought I would put it out there so that people can think about it. I have planned on using Speex speech codec for the speech in Hack Mars. I plan on using Ogg Vorbis audio codec for my music audio. I found that the easiest sound system for my setup is SDL_mixer. It has automatic loading for many audio codecs. Specifically, it can load Ogg files with one line of code. That's very nice. I found that Speex is not supported by SDL_mixer. That's a problem, isn't it? Well, it's quite possible that I can write a library for SDL_mixer to load Speex. Since it's pretty simple (people only say things once), it can be just a load and throw mechanism instead of a stream or such.

The reason I want to use Speex is because I am frugal and want to make Hack Mars available for Bit Torrent download. I thought that if I use Ogg at 128 kbps, 10 hours of audio (600 MB) would nearly fill a cdrom. I wouldn't have room for the textures, meshes, and the game itself. So I decided that for my audio, I can use this sweet codec, Speex at 8 kbps to reduce the size to a measly 37.5 MB or something similar.

But then I started thinking about Ogg. It may be easier and better to go the other way: try to make ogg smaller. Music encoded with Ogg at quality 3 (default) is usually around 100 kbps. That's what I've encoded all my music collection as. But what happens as I decrease the quality and/or nominal bitrate? Using a 44.1 kHz mono speech sample to test, I get the following results:

Quality  | rate (kbps)
3        | 79.6
1        | 65.2
32 nom   | 40.3
32 @ 8k  | 32.5
32 @ 16k | 32.6

The "32 nom" means that I used nominal bitrate of 32 kbps. You can see that ogg has a decent range of bitrates from 32-160. In fact, it encroaches onto Speex's territory with the 16k at 32 kbps. Speex does 16k at 32 kbps, so they are really the same. For a video game, a developer should want high quality if it is available. It is available, so the only question is whether there is a market for 8 Khz 8 kbps. It's a factor of four size savings (37.5 MB vs. 150 MB) for a factor of 2 sample rate. I might say no, but just the other day I was complaining about Grand Theft Auto Classic being 350 MB download (my main problem was the fact that it was unresumable). Would I be willing to push that time cost onto the downloaders? Maybe I could make two versions, but that seems like it would be a pain for the users (especially since BitTorrent is all about fat pipes and small pipes working together to achieve a common goal).

Permalink

Comments: 0

Leave a reply »

 
  • Leave a Reply
    Your gravatar
    Your Name