Attached is the latest version of my new sound mixer patch for OpenTTD. Note that this doesn't include new music support (that's in a different patch), but it does lay the foundations for it.
This patch features:
- New sound mixing engine, mostly nicked from ScummVM with various modifications
- Support for 16-bit, stereo, 44.1KHz audio, as opposed to TTD's 8-bit, 11.25Khz audio
- Support for reading audio files from memory (ie, sample.cat/opensfx.cat/newgrf-style), or from separate files (currently, just .wav, although MP3, FLAC and Vorbis are supported in the music patch)
This patch also provides basic support for the Sound Replacement project. If it finds that sample.cat does not exist or does not match its md5sum, it will look for opensfx.cat and use that instead. (Future versions will check MD5 of this, but as opensfx.cat isn't finished yet, this check isn't implemented). A test opensfx.cat is available too (using the latest sounds posted to the Sound Replacement Project thread, with various "filler" sounds for those not implemented), along with a program to generate it. Note that all sounds in opensfx.cat must currently be signed 16-bit mono. (Frequency doesn't matter, although 44.1KHz is preferred.)
I don't forsee the patch being accepted into trunk for the time being due to the large number of files it adds, mostly miscellaneous classes used by the mixer for reading file and memory streams. But who knows. If the devs could offer some feedback, that would be useful. (I'll post this on flyspray once I've had a few comments about it here.)
The patch should build cleanly on Windows (MSVC and MinGW), Linux and Mac OS X. Not tested on any other systems, but I don't see why it shouldn't work.

Note that depending on the tool you use to apply the patch, it may not create the mixer/ directory and place the mixer files in it. If you find a bunch of cpp and hpp files in your source root directory, that may be why. Move them to src/mixer/.
Any comments, queries, problems, please post here.

opensfx.cat
Available from http://www.owenrudge.net/various/opensfx-0.1.zip (7.82MB)
Note that you must rename/delete sample.cat for opensfx.cat to be used. Once opensfx.cat is finished, it can be made the default.
opensfx encoding utility
Available from http://www.owenrudge.net/various/opensfx-encode-0.1.zip (10.1MB). Win32 .exe included, source code available for other platforms. Uses a very simple input.txt file - reads a filename, and adds it to opensfx.cat. May be buggy, but seems to work for me. Includes all necessary sound files to build a .cat.
EDIT: Uploaded version 2.2.1 of the patch, which removes some unnecessary code.