Streaming sound tracks, FMOD linking improved

Posted on

Castle Game Engine logo with title
  1. Our sound engine now supports streaming sounds.

    “Streaming” means that we decompress the sound (like OggVorbis) during playback, in parts (as needed). This technique allows much faster sound loading (loading sound as “streamed” is almost instant). It adds a small run-time overhead to playing given sound, although in practice it is not noticeable at all, even on mobile devices (where the benefits — much faster loading — will be very noticeable 🙂 ).

    In general case, I advise to use it for longer sounds (like music tracks).

    The default remains to load sounds “complete”, just like before.

    To use this feature, call LoadBuffer method with slStreaming or use <sound ... stream="true" /> in sounds XML file. See the manual about sound for general information how to play sounds, including LoadBuffer and sounds XML files. An example is in our play_sounds example, just uncomment proper lines in gamestatemain.pas and CastleEngineManifest.xml (search for “streaming”).

    This feature works with both OpenAL and FMOD sound backends.

    Thousand thanks for implementing this feature go to Andrzej Kilijański!

  2. FMOD dynamic loading is now improved, which is particularly useful for Linux users.

    • The FMOD library no longed needs to be present at compile-time on Linux, it only needs to be present at run-time. You no longer need to pass -k-L... to FPC to link with FMOD.

    • If the FMOD library is not present at run-time, we make a warning (in log) and continue using existing backend. In effect, you can have the application use FMOD if possible, but fallback on OpenAL. This applies to all platforms using dynamic loading of FMOD, like Windows and Linux.

    • It fixes problems with linking with FMOD using GNU binutils 2.32 (like in Debian
      Testing). The linker was previously reporting errors bad value.

Start the discussion at Castle Game Engine Forum