Results 1 to 4 of 4

Thread: [OpenAL] Multi- to Single Channel

  1. #1

    [OpenAL] Multi- to Single Channel

    Hi everyone

    I'm trying to implement some kind of basic sound module, based on OpenAL. I read that OpenAL can only use mono-sounds for 3D sound. So i like to know whether it's possible to let OpenAL convert or treat a multichannel sound, in such a way, that it can be used for 3d-playback.

    Just wondering if there is another way than converting the sounds one by one to mono. :?

    Thanx
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  2. #2
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    [OpenAL] Multi- to Single Channel

    Well you know the reason why multichannel is not practical for 3D sound right?

    Just in case you or others don't: Left and Right channel... think about how that works in 3D? Where is your right and where is your left in a 3D space.


    Considering that though, I can't think of a reason why you couldn't mix the stereo samples into a mono channel in real time. Mind you, would you really want to considering that it's just going to waste cpu juice that could be better used to mix the 3D sound instead?


    If you are able to use streams or raw allocated memory with AL playback then you could pre-mix your stereo wave files at the time they are loaded and store them as a single channel sample. Actually this method would probably reduce the amount of memory required to have stored the original sound data by half.


    :?: Does anyone know of a tutorial/instructions on how to mix 2 audio channels without hardware or some other damn library? :?:

    I used to have a page that had this info before, but I can't find the link. I can't believe this kind of programming is so hard to find these days! :?
    Jason McMillen
    Pascal Game Development
    Co-Founder





  3. #3
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    [OpenAL] Multi- to Single Channel

    Ah found it! I'm such a dumby.

    http://www.vttoth.com/digimix.htm
    Jason McMillen
    Pascal Game Development
    Co-Founder





  4. #4

    [OpenAL] Multi- to Single Channel

    Thanx will

    I think writing a channel mixer for WAV might be more work then most people think.
    Look at this page: http://en.wikipedia.org/wiki/Audio_file_format

    Near the bottom it says:

    – standard audio file format used mainly in Windows PCs. Commonly used for storing uncompressed (PCM), CD-quality sound files, which means that they can be large in size — around 10 MB per minute of music. It is less well known that wave files can also be encoded with a variety of codecs to reduce the file size (for example the GSM or mp3 codecs). Wav files use a RIFF structure.
    So when i write my own WAV importer and mixer, it cannot deal with the compressed formats.
    I guess that the aLutLoadWAVFile function CAN handle most (or ALL) of the WAV format's, so why should i replace it with a routine that probably can't do that. So i guess making my samples mono with some Audio-software is the best option.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •