Commit Graph

511 Commits

Author SHA1 Message Date
Thierry Crozat
5d419c2b58 AUDIO: Rename two functions in ModuleModXmS3m
This is an attempt to fix a compilation error on some platforms.
The error message seems to indicate that log2 might be a define
on thos platforms.

Note that the log2 implementation in ModuleModXmS3m is not the binary
logarithm, and we cannot use Common::intLog2.
2017-09-11 21:38:58 +01:00
Simei Yin
6558578f54 AUDIO: Import micromod code, xm/s3m/mod decoder 2017-09-11 08:10:09 +02:00
Colin Snover
dbf2f0c266 AUDIO: Fix compilation on AmigaOS 4 2017-09-10 02:08:21 -05:00
Colin Snover
10db6e9a44 AUDIO: Mark SCI engine as using ADPCM 2017-09-09 23:29:58 -05:00
Colin Snover
41506201b9 AUDIO: Fix incorrect reading of DK3 ADPCM audio data
Previously, _topNibble was not reset at the beginning of a new
audio block, and the alignment byte at the end of odd blocks was
being read as audio data, which caused audible clicks and
out-of-bounds sample generation. There may have also been read
errors related to the use of continue/break keywords inside of a
macro wrapped with do-while(0).

The introduction of partial block reads in this code when it was
converted from ffmpeg to a ReadStream interface was also confusing
and somewhat inefficient (calling SeekableReadStream::pos
frequently), so this code has been refactored for clarity and to
improve efficiency by reducing the number of virtual calls. Error
detection has also been improved somewhat by ensuring that there
are enough bytes to read a block header, and that the step indexes
in the header are within the valid range.
2017-09-09 23:29:58 -05:00
Willem Jan Palenstijn
dde259f068 COMMON: Remove BitStream base class to allow inlining calls
All users of BitStream were in fact using a specific, hardcoded variant,
so we can hardcode that variant, removing the need for virtual calls,
and enabling inlining.
2017-08-24 19:46:59 +02:00
Torbjörn Andersson
a31fcfff2e AUDIO: Fix some more suspicious-looking expessions
GCC did not warn about these, but surely it should be bitwise OR,
not logical OR, here as well. But I don't think I have any game that
uses MaxTrax (Amiga version of Legend of Kyrandia?), so I can't
really test this.
2017-08-12 07:24:48 +02:00
Eugene Sandulenko
edeb6a636c AUDIO: Fix insufficient memset length in FM-TOWNS synthesizer 2017-08-11 21:55:59 +02:00
Eugene Sandulenko
859b54222f AUDIO: Fix incorrect boolean statement in MaxTrax decoder 2017-08-11 21:52:44 +02:00
Torbjörn Andersson
665f5c99b2 JANITORIAL: Silence some more GCC 7 fall through warnings
I think these are the last one that were already flagged as being
deliberate.
2017-08-06 16:54:38 +02:00
Willem Jan Palenstijn
867511d2d0 MT32: Update Munt to 2.0.3
This update uses upstream commit
777c51cdb4dbb4e02a53c23edea9086f0b600e26.

The new SampleRateConverter is added, but not built as we don't use it.
Also, building it without source changes will need additional include
directories.

This update of Munt reduces the stack size, and thus fixes bug #9630.
2017-02-28 18:40:04 +01:00
D G Turner
77818e9683 MT32: Fix Set-But-Unused Compiler Warning. 2017-01-14 09:14:02 +00:00
Paul Gilbert
7b10dac542 AUDIO: Support Wave files with an initial fact chunk 2016-12-20 22:47:49 -05:00
Colin Snover
b93f4f06e4 MT32: Really add the virtual destructor 2016-12-18 10:25:58 -06:00
Colin Snover
d585c6f852 MT32: Fix virtual dtor warning, incorrect delete, unnecessary allocation 2016-12-18 10:20:23 -06:00
Eugene Sandulenko
f98730028c MT32: Prevent Munt from including <fstream> 2016-12-17 20:32:04 +01:00
Colin Snover
1e23c91914 MT32: Fix driver to be thread-safe 2016-12-16 15:44:29 -06:00
Colin Snover
b8d70d26fa MT32: Update Munt to 2.0.1-pre
This update uses upstream commit
f88ef828a600ce66d1f730c8fb2a7f580f6f6165.

This update switches to use the new Munt C++ interface, which
will allow ScummVM to link to an external Munt library instead
of requiring it to be built-in in the future. For the moment,
the emulator is still built-in, since it is not available from
most package repositories.

The Munt driver in ScummVM now uses writeSysex instead of the
(now-private) playSysexWithoutFraming, per recommendation from
the Munt team <https://github.com/munt/munt/pull/30>.

This changeset also removes direct modifications that used to be
made to Munt code, to ease future updates. To update Munt code in
the future:

1. Replace all source files in the `softsynth/mt32` directory with
   new files from the upstream `mt32emu/src` directory;
2. Update `config.h` with the correct version number for the new
   version of Munt;
3. Update `module.mk` to add any new source files that need to be
   built.
2016-12-16 15:44:29 -06:00
Colin Snover
df4a503622 Revert "MT32: Update Munt to 2.0.0"
This reverts commit b4dbd6d3c2.
2016-11-25 12:24:08 -06:00
Colin Snover
b4dbd6d3c2 MT32: Update Munt to 2.0.0
This changeset also removes unnecessary direct modifications to
Munt code to ease future updates. To update Munt in the future:

1. Replace all source files in the `softsynth/mt32` directory with
   new files from the upstream `mt32emu/src` directory;
2. Update `config.h` with the correct version number for the new
   version of Munt;
3. Update `module.mk` to match the list of sources given in
   `mt32emu/CMakeLists.txt libmt32emu_SOURCES`.
2016-11-25 12:14:13 -06:00
Thierry Crozat
0908fd2225 MT32: Use OSDMessageQueue to post OSD messages from the MT32 thread 2016-10-29 15:13:32 +01:00
Eugene Sandulenko
355c4fa646 JANITORIAL: Remove more trailing spaces 2016-10-09 15:02:02 +02:00
Torbjörn Andersson
579c024653 AUDIO: Keep packetized MP3 stream from ending prematurely
This fixes the audio in the intro AVI movie for German Fullpipe.
2016-09-19 07:25:55 +02:00
jepael
5cc2696deb AUDIO: Fix CMS chips incorrect pitch.
The CMS emulation assumes the chips run at 8 MHz clock,
but in PCs they run at 7.15909 MHz, so the emulated pitch
is too high. Adjusting the requested sampling rate higher
by matching amount the pitch is lowered down to normal.
2016-09-07 23:22:18 +03:00
Paul Gilbert
7d0c83850c AUDIO: Whitespace fix in MP3 engine usage list 2016-09-03 09:58:50 -04:00
Paul Gilbert
4d11f2fbf0 AUDIO: Add Titanic to list of engines using MP3 decoder 2016-09-02 23:56:44 -04:00
Paul Gilbert
d7e52b4b50 AUDIO: Disable MP3 decoding in Wave files if MAD dependency is disabled 2016-09-02 23:54:55 -04:00
Paul Gilbert
417cc51bcb AUDIO: Add support for MP3 encoded data in WAVE files
This is needed for playback of Starship Titanic speech data
2016-09-02 21:32:32 -04:00
Paul Gilbert
b312c8fe9d AUDIO: Add titanic to list of engines using wave files 2016-08-05 19:19:17 -04:00
Willem Jan Palenstijn
567054d829 AUDIO: Fix build 2016-07-31 08:55:12 +02:00
Eugene Sandulenko
30498bfbf0 AUDIO: Fix indentation 2016-07-31 09:28:46 +03:00
Torbjörn Andersson
9382dab811 AUDIO: Fix audio corruption in MS ADPCM decoder
Since _decodedSamples[] is filled with either 2 or 4 samples, we
can't use 1 - (count - 1) to "ensure that acts as a FIFO". When
we have 4 samples, that index will become negative, putting
uninitialized data into the buffer.

We could still use a similar trick, but I think it's much clearer
to use an index variable like this. We need an addition variable
either way.
2016-07-06 20:51:28 +02:00
Colin Snover
848abbee06 AUDIO: Fix incorrect forward declaration 2016-06-21 08:33:50 -05:00
Colin Snover
cbc3b773aa AUDIO: Make WAV streams seekable
This allows raw PCM in WAVE containers to have duration and be
seekable, and opens the door for ADPCM streams to be seekable later
if necessary.

This change is needed to avoid duplication of RIFF/WAVE container
parsing for SCI engine, which uses raw PCM WAVE files and needs to
be able to determine their lengths.
2016-06-19 14:48:33 -05:00
Eugene Sandulenko
8e0447e926 AUDIO: Fix memory corruption.
Since it was --voice, we were reading element index -1.
2016-05-31 17:12:18 +02:00
Eugene Sandulenko
33184e822d AUDIO: Plug potential memory leak 2016-05-15 12:26:15 +02:00
Eugene Sandulenko
fb18a15b97 AUDIO FM-TOWNS: Fix copy/paste error 2016-05-08 23:21:11 +02:00
Ori Avtalion
3564032330 JANITORIAL: Reduce audio header dependencies 2016-04-14 16:10:21 +03:00
Tobia Tesan
914537ab52 JANITORIAL: Mark audio/decoders/vorbis as: used in Wintermute 2016-03-28 12:36:41 +02:00
Johannes Schickel
6cb2148e0a AUDIO: Use MUNT's sample rate for MT-32 emulation. 2016-03-18 20:51:21 +01:00
Johannes Schickel
1ed261dac4 AUDIO: Make MT-32 emulator play MIDI events immediately.
This fixes the Indiana Jones and the Fate of Atlantis specific issue reported
in bug #6242 "AUDIO: Built-In MT-32 MUNT Produces Wrong Sounds".

Delaying MIDI events has been introduced with Munt 1.3.0.

Regression from 00992c1e68.
2016-03-18 20:51:21 +01:00
Alexandre Detiste
6c298e964f JANITORIAL: Typos detected with lintian & grep 2016-02-15 18:27:02 +01:00
athrxx
05aa32dc21 AUDIO: fix two bugs in FM-TOWNS pcm code 2016-01-09 22:09:53 +01:00
Johannes Schickel
419419c860 AUDIO: Fix clang warning in mame.cpp. 2016-01-07 15:04:10 +01:00
Ori Avtalion
d8045c6727 JANITORIAL: Fix clang printf warnings 2016-01-07 14:55:32 +02:00
Johannes Schickel
1baf3bed7a AUDIO: Use standard line warps in iOS7 hack comment in fluidsynth.cpp. 2016-01-07 11:00:28 +01:00
Johannes Schickel
ded43d795a AUDIO: Remove unused includes in fluidsynth.cpp. 2016-01-07 10:59:15 +01:00
Vincent Bénony
b5ef98637c IOS: Renames a macro 2016-01-07 09:55:56 +01:00
Vincent Bénony
a56c587651 IOS: Fluidsynth path hack only for iOS 7 2016-01-06 16:20:29 +01:00
Vincent Bénony
9adf7cd570 IOS: Uses Common::String instead of plain C string 2016-01-06 16:20:29 +01:00