Commit Graph

15 Commits

Author SHA1 Message Date
Jonas Kulla 5f290c5b11 Audio: Prevent div-by-zero 2013-12-15 10:12:44 +01:00
Jonas Kulla 3b8484a280 Audio: Silence "unused" errors with latest libvorbisfile 2013-12-11 21:08:40 +01:00
Jonas Kulla 946d778b96 Audio: Fix BGM not starting after ME has ended
A previous commit prevented the MeWatch from
starting a BGM stream that was in stopped state.
However, when a new BGM is loaded while the ME
is still playing, the BGM stream will be stopped
even though we want it to start after the ME
finishes.

Also add some comments trying to explain members
of 'AudioStream' a bit better.
2013-12-08 12:58:39 +01:00
Jonas Kulla 5fca94616c Audio: Implement RGSS3 functionality
'Pos' and 'Play' functions take a float for
their 'pos' parameter, which is in seconds
of playback.

'setupMidi' is a noop at this point.
2013-12-05 00:24:18 +01:00
Jonas Kulla 9a63140f3e Audio: MeWatch: Don't resume stopped BGM 2013-12-04 17:16:18 +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 a817b31e7c Audio: Remove all traces of rubberband
We will not be using librubberband for in place
pitch shifting. RMXP "shifts" PCM based audio
by just playing it back slower/faster, which
OpenAL takes care of for us. A native midi backend
will be able to effortlessly pitch shift by
multiplying note pitches, should we ever get one.

I have been chasing this ghost for way too long.
2013-12-04 14:49:35 +01:00
Jonas Kulla e26d0366f1 Revert "Audio: Make cheap OpenAL pitch shifting a config option"
Making this an option makes no sense. It ought to
be the default behavior, as RMXP pitch shifts PCM
based audio files the exact same way.

This reverts commit ac35d4214e.
2013-12-04 13:39:39 +01:00
Jonas Kulla ac35d4214e Audio: Make cheap OpenAL pitch shifting a config option 2013-12-01 09:36:15 +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
Jonas Kulla 39436ad231 Fix up SDL2 include paths
Using "SDL2/SDL_xxx.h" instead of "SDL_xxx.h" caused
the include paths provided by pkg-config to be ignored,
and headers from a standard include path to be used instead.
2013-10-13 23:21:34 +02:00
Jonas Kulla cb6f73f7df Rename 'GlobalState' to 'SharedState' to avoid confusion with GLState
This was particularly nasty with the shorthand macros
'gState' and 'glState'. The former is now 'shState'.
2013-10-09 12:30:33 +02:00
Jonas Kulla 6a85699e11 Properly destroy fade thread 2013-09-04 17:53:12 +02:00
Jonas Kulla 84db116d0c Rename 'bound' to 'clamp' 2013-09-03 15:31:29 +02:00
Jonas Kulla ff25887f41 Initial commit 2013-09-01 16:27:21 +02:00