Commit Graph

6 Commits

Author SHA1 Message Date
Jonas Kulla 80937d0d06 ALStream: Fix sometimes not unqueuing all buffers before play
Very rarely rogue buffers would remain and play on loop on song
switch because we only ever cleared processed, not queued, buffers
from the source.

The correct way to completely clear a source's queue is to
simply attach a null buffer to it.
2014-07-31 03:39:36 +02:00
Jonas Kulla f73b0ba4b5 audio.cpp: Split up into smaller parts 2014-07-23 17:28:20 +02:00
Jonas Kulla 0ef68a2eb7 Audio: Remove unused float helper code
Let's us get rid of 'alext.h' include,
which doesn't exist on OSX.
2014-05-24 18:26:04 +02:00
Jonas Kulla 4219b91bbb al-util.h: Add include fix for older OpenAL releases
Apparently older versions of 'alext.h' didn't include
'alc.h' despite dependencies on ALC types.
2014-02-06 04:27:17 +01:00
Jonas Kulla 04526987e4 Audio: Implement RGSS2 ogg looping
With this we now link to libvorbis/ogg directly.
When this is enabled, one can theoretically also
build SDL_sound without ogg support, although I
doubt it makes much of a difference.

Adittionally, count frames instead of samples
for playback offset calculation.
2013-12-04 16:44:34 +01:00
Jonas Kulla 64f35071ab Audio: Replace SFML solution by using OpenAL directly
This is a major change in the Audio module that comes with
many changes throughout the codebase and dependency list.
The main gist is that we're finally nuking the last pieces
of SFML from the project. sfml-audio brought with itself
unneeded and big dependencies (libsndfile, libvorbisenc)
while at the same time limiting the amount of audio formats
mkxp can support (eg. we now get mp3 for free, and wma/midi
can be implemented by extending SDL_sound directly).

The increased control gained by interfacing with OpenAL directly
will also allow for easy integration of a dedicated audio
stretcher (librubberband), as well as enable us to implement
looped ogg vorbis (via the 'LOOPSTART'/'LOOPLENGTH' tags),
as required by RGSS2, in the future.

The FileSystem class has had its SFML parts removed.
Aditionally, audio file extensions to be supplemented are
now automatically detected based on how SDL_sound was
built (ie. if no mp3 support was built, mkxp won't try
to look for *.mp3 files). The final used extension
can be optionally returned by 'openRead' calls so
SDL_sound and SDL2_image can immediately choose the
right decoder.

The OpenAL context is created and destroyed in main.cpp
along side the GL context.
2013-11-30 12:00:11 +01:00