Page 1 of 3 123 LastLast
Results 1 to 10 of 27

Thread: Win/Linux/Mac OSX Sound API with no .DLL/.SO dependencies?

  1. #1

    Win/Linux/Mac OSX Sound API with no .DLL/.SO dependencies?

    Hi all,
    I am writing a cross-platform game engine (Windows first, Linux later, and then maybe Mac OSX), and I am hoping to add in some sound support (.wav files first, then maybe .ogg).

    I am hoping to do the sound loading/playing without using some external .DLL/.SO file, and just use some Pascal units.

    This is to keep down the number of external libraries that I need to deploy with my engine .DLL/.SO file...

    Does anyone here know of such a beast?

    I know I could use OpenAL, BASS, FMOD, Audiere, but those need an external .DLL/.SO file, don't they?

    Maybe I could use the WaveOut API on windows, but what can I use under Linux/Mac OSX?

    cheers,
    Paul
    Games:
    Seafox


    Pages:
    Syntax Error Software itch.io page

    Online Chess
    http://gameknot.com/#paul_nicholls

  2. #2
    Windows - DirectSound
    Linux/MacOS X - OpenAL is de facto standard

    If you want something like WaveOut in Windows, then you will be needed to use ALSA(as much popular than OSS) for Linux and CoreAudio for MacOS X.

  3. #3
    Thanks for the info mate

    One question...does OpenAL come pre-installed on Linux/MacOSX...or does one need to install it themselves? I am guessing that maybe Linux needs the user to install it, but maybe not in Mac OSX.

    I will look up ALSA and CorAudio...

    cheers,
    Paul
    Games:
    Seafox


    Pages:
    Syntax Error Software itch.io page

    Online Chess
    http://gameknot.com/#paul_nicholls

  4. #4
    OpenAL is pre-installed on MacOS X and iOS. What about Linux - you can always use dependencies list, but Linux system with games and without OpenAL - something far from reality, IMHO )
    Last edited by Andru; 07-09-2011 at 10:14 AM.

  5. #5
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25
    OpenAL is pretty much the best thing you could use for cross-platform. If you are doing windows only, you can just use DirectSound if you prefer, but I woudn't try using much else unless you want headaches while trying to port your sound system over to new platforms. You'll just end up having to rewrite your games sound code for each platform.

    Linux users shouldn't need user-friendliness, they're all super-geeks anyways. Just tell them what they need. Mac users will love you for using OpenAL and putting everything into one single bundle nicely/properly. Esp. those that like the new Launchpad for Lion.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  6. #6
    Quote Originally Posted by will View Post
    linux users shouldn't need user-friendliness, they're all super-geeks anyways.
    bwahahahahaha!!!

    Ok, I'm sold...I will go for OpenAL then guys, thanks all! I will just ignore the fact that I need to deploy the extra DLL then

    cheers,
    Paul
    Games:
    Seafox


    Pages:
    Syntax Error Software itch.io page

    Online Chess
    http://gameknot.com/#paul_nicholls

  7. #7
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    Just dropping a line to say two things really:
    1. OpenAL
    2.
    linux users shouldn't need user-friendliness, they're all super-geeks anyways.
    That wasn't entirely true when I started out, but now I'd have to almost agree. Ever since I stopped using a mouse for most things and replaced it by Ctrl + Alt + t and Alt + F2 with the ls, top, cat and similar reflexes - windows feels ancient
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  8. #8
    Quote Originally Posted by code_glitch View Post
    Just dropping a line to say two things really:
    1. OpenAL
    2.
    hehe, shouldn't that have been:

    1. OpenAL
    2. OpenAL
    3. OpenAL
    ...
    N. OpenAL

    Quote Originally Posted by code_glitch View Post
    That wasn't entirely true when I started out, but now I'd have to almost agree. Ever since I stopped using a mouse for most things and replaced it by Ctrl + Alt + t and Alt + F2 with the ls, top, cat and similar reflexes - windows feels ancient


    cheers,
    Paul
    Games:
    Seafox


    Pages:
    Syntax Error Software itch.io page

    Online Chess
    http://gameknot.com/#paul_nicholls

  9. #9
    Ok, I have now made an OpenAL sound audio class, but i am having troubles;

    I have the code below:

    Code:
    const
      cMaxSources = 10;
    
    type
      TxeAudio = class(TxeBaseObject)
      private
        FSounds     : TStringList;
        FSourcePool : array[0..cMaxSources - 1] of TALuint;
      public
    Code:
    constructor TxeAudio.Create;
    var
      ALResult: TALenum;
    begin
      inherited Create(False);
    
      if not InitOpenAL then
      begin
        LogFile_LogMessage('Error initializing OpenAL!');
      end;
    
      alGenSources(cMaxSources,@FSourcePool[0]);
    
      ALResult := alGetError;
    
      if ALResult <> AL_NO_ERROR then
      begin
        LogFile_LogMessage('Error creating OpenAL sources!');
      end;
    But for some reason when I call alGenSources(), my FSourcePool array is all zeros still, and I am getting no error (or log file output).

    Is this normal?

    cheers,
    Paul
    Games:
    Seafox


    Pages:
    Syntax Error Software itch.io page

    Online Chess
    http://gameknot.com/#paul_nicholls

  10. #10
    I don't know if I am having trouble as I had to modify the openal.pas file to compile under Delphi 2010?

    I changed al PChar to PAnsiChar and Char to AnsiChar for example...

    Does anyone here have an openal.pas file that is already updated to work under D2010/freepascal?

    cheers,
    Paul
    Games:
    Seafox


    Pages:
    Syntax Error Software itch.io page

    Online Chess
    http://gameknot.com/#paul_nicholls

Page 1 of 3 123 LastLast

Tags for this Thread

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
  •