Loading sound with OpenAL

Everything about development and the OpenMW source code.
Locked
User avatar
lgromanowski
Site Admin
Posts: 1193
Joined: 05 Aug 2011, 22:21
Location: Wroclaw, Poland
Contact:

Loading sound with OpenAL

Post by lgromanowski »

Chris wrote: There is a utility library for OpenAL called Alure, which is designed to load various audio file formats into OpenAL, and makes streaming much nicer. On its own it supports standard PCM wav files, but the latest Git version can also use libvorbisfile, libmpg123, libflac, and libsndfile for extra formats. It lets you override the file I/O routines, so the custom VFS layer can plug right in.

A potential problem, though, is that it ties directly with OpenAL. You give it a filename and it gives you an OpenAL buffer object, or a stream object that's used with an OpenAL source. It can't be used as a stand-alone audio decoder. However, it's much more diligent in detecting what formats OpenAL can accept, and so can avoid conversions in some places (or simply allow the format to even work, when no conversion is possible).

For OpenMW's purposes, it would still need libmpg123 for MP3 decoding, but libsndfile would not be needed. Additionally, the support libraries can be configured to be hard or soft dependencies, so it can either require the support libs, or just use them if available and skip them if not. Alure itself can be statically built and linked, so the only DLLs would be those of the optional support libs.


If anyone wants to do it, I can help them on Alure's side. If not, I can try to do it myself. But since I'm not very familiar with OpenMW's sound system (besides that it's in Mangle, and separated into input and output components), I would need some help in actually getting it integrated.Alure would also likely need to be set up as a subproject or submodule, which I'm also not familiar with handling.

Thoughts? Ideas? Help?
nicolay wrote: Thanks for the info and for the offer of help. However I personally think we already have this handled pretty well with the current system. IMHO I don't really think we need to spend even more time on the sound system at this time, and especially not on switching it out when the current one works fine. Hope that's understandable.
Chris wrote:
nicolay wrote:Thanks for the info and for the offer of help. However I personally think we already have this handled pretty well with the current system. IMHO I don't really think we need to spend even more time on the sound system at this time, and especially not on switching it out when the current one works fine. Hope that's understandable.
Understandable. I was just looking forward since Alure is already written to support a bunch of formats across multiple architectures, handles some quirky files (wav files that have extra chunks before the fmt/data, MP3 that's embedded in a .wav file, etc), and will be able to support loop points once OpenAL can.. all for "free".

If you want to wait, though, that's fine. I don't intend to drop anything anytime soon.
Locked