Is there any discussion on how to do the audio encoding? On my list of conversions to do is Berzerk and I would like to include the speech with the option to do so without the Speech Synthesizer. I have attached samples for which I think our console-based playback is well-suited.
I thought I talked about it, but I can't locate it. For game speech though, you'll either need a clever main loop or you'll have to pause the game to talk (Berzerk should allow for the former, though, and that would be bloody amazing).
You can look at the source for 'audioconvert' in my package, but the discussion that I thought I'd written up somewhere was pretty simple.
Basically, the straight-forward way to do it, is just to divide the audio down to 4-bit resolution. This actually works and sounds okay as long as the audio has reasonable volume. For soft things like the intro to Let It Go, I was getting very staticy or outright silent areas.
The second approach I tried, what I use in my MOD converter, was to map each audio level to the sound chip's logarithmic output (just using a simple search, there are only 16 values). This is technically more accurate reproduction, but loud audio loses a lot of resolution and quiet audio still suffered from the problem of ending up muted a lot. The main reason this is an issue is that audio goes positive and negative around a center point, but TI audio is (essentially) positive only, with all the resolution down near 0.
I /did/ attempt to map all audio positive - I tried two approaches. One was to swing negative transitions positive. This worked, but was crazy noisy. The other was to /discard/ negative transitions. Surprisingly, this /also/ worked and was less noisy. But playing the whole waveform centered in the TI space still sounded better. The problem was once you're in the center of the logarithmic scale, you've already lost a lot of the resolution available at the low end - that's now at the bottom of the curve.
So for this converter, I threw accuracy out the window, and hand-wrote a volume mapping table that emphasized softer sounds. That seems to work pretty well - although very loud sounds are now a little more staticy, at least EVERYTHING can be heard.
Each sample is just matched to the value in the table that it comes closest to.
It's just a sample mapper, your basic trick will be to determine the sample rate that your code outputs at. This video player is around 13khz. Since Berzerk used a speech chip, it was around 8khz, and you could probably easily get away with 4khz. That should give you room to play.
The sample conversion doesn't care about the rate, you do that externally.