Commit Graph

10 Commits

Author SHA1 Message Date
Glenn Maynard 1bd5513698 Switch to floating-point sound internally.
This allows us to change the volume of sounds in filters ("volume",
"fade" properties) without quantizing the audio prematurely.  Previously,
we had a hack to apply volume changes as a mixing-time step.  This
can be done at any point in the filter chain now.

This also means we only need to worry about clipping at the very
last mixing step, instead of at every place we change sound.

Dithering for 16-bit audio and more intelligent gain control
is possible, as we have full-resolution, unclipped sound at the
mixing phase.

We support high resolution source sounds; both Vorbis and MAD
supply more than 16 bits.

Several filters, such as resampling, are easier to implement as
floats; these no longer need to convert back and forth.

Negatives:
 - More memory use.  The main case of this is in RageSoundReader_Preload,
which will be fixed: we can preload in 16-bit without losing most of the
above.
 - Some extra overhead for accessing more memory.
2007-01-27 07:14:58 +00:00
Glenn Maynard fd4b5f93bb RageSoundReader::Read(char *) -> int16_t *. This was originally
char * based on the idea of supporting more than one sample type.
I don't plan to do that (though I may change the sample type to float
or int32).
2007-01-20 01:10:24 +00:00
Glenn Maynard 129250bfd0 handle STREAM_LOOPED 2006-12-22 12:09:36 +00:00
Glenn Maynard a844c8b1c9 add RageSoundReader::RetriedRead 2006-12-22 06:08:40 +00:00
Glenn Maynard b91f803518 rename SoundReader -> RageSoundReader 2006-11-28 22:42:13 +00:00
Glenn Maynard 040be62a85 register RageSoundReader 2006-11-26 01:42:46 +00:00
Glenn Maynard 414c1a3bf6 unused 2003-09-13 06:09:04 +00:00
Glenn Maynard 5701a25f16 Add RageSoundReader_Vorbisfile.
Remove RageSoundReader_SDL_Sound.
Fix error reporting.
2003-09-13 05:09:35 +00:00
Glenn Maynard 83f976f9dd RageSoundReader_MP3 2003-09-13 01:34:34 +00:00
Glenn Maynard b9efc67d02 add SoundReader::OpenFile 2003-09-10 21:34:01 +00:00