Commit Graph
25 Commits
Author SHA1 Message Date
Glenn Maynard 1bdbe78390 support preloading in 16-bit 2007-02-01 03:42:33 +00:00
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 00f371fa7c remove IsStreamingFromDisk 2006-12-23 07:15:32 +00:00
Glenn Maynard cc043b3d16 no error here 2006-12-23 07:00:28 +00:00
Glenn Maynard 7385c1f4c1 merge SetPosition_Accurate and SetPosition_Fast. Use a property
instead.
2006-12-10 08:59:13 +00:00
Glenn Maynard 25e67dd4dc RageSoundReader::Read(buf, unsigned bytes) -> (buf, int frames);
return value in frames, not bytes
2006-12-10 03:56:36 +00:00
Glenn Maynard ca67a9cb7c change SetPosition_Accurate and SetPosition_Fast to take and return frames 2006-12-09 06:35:09 +00:00
Glenn Maynard f41362f7a9 SoundReader -> RageSoundReader 2006-11-30 04:19:51 +00:00
Glenn Maynard c68c60c67a GetNextStreamFrame -> GetNextSourceFrame 2006-11-29 09:15:23 +00:00
Glenn Maynard e3b98efd66 GetNextStreamFrame, GetStreamToSourceRatio implementations 2006-11-29 08:15:22 +00:00
Glenn Maynard d5e7260f59 use AutoPtrCopyOnWrite 2006-11-26 18:33:29 +00:00
Glenn Maynard c855b21a7f remove unused 2006-11-25 22:47:01 +00:00
Glenn Maynard b52c8f9966 style 2006-11-25 22:46:47 +00:00
Glenn Maynard 7a95f5da5b covariant Copy() 2006-10-20 00:01:18 +00:00
Glenn Maynard c3ff27796a add GetReferenceCount 2005-07-18 19:06:32 +00:00
Glenn Maynard f07ac5cf74 comment, cleanup 2005-02-13 03:13:33 +00:00
Glenn Maynard c85de593f9 s/SoundReader_Preload/RageSoundReader_Preload/
split RageSoundReader_Preload::PreloadSound
split RageSound::LoadSoundReader
2004-10-24 19:25:21 +00:00
Glenn Maynard ed2939b205 IsStreamingFromDisk 2004-08-21 07:01:54 +00:00
Glenn Maynard 27243e074c working on variable channel count support (to allow preloading mono samples
in half memory, and to avoid redundant resampling in mono files)
2004-07-24 01:22:10 +00:00
Glenn Maynard f9f10e2372 more license updates 2004-05-06 02:40:33 +00:00
Glenn Maynard 6acfd7a22e remove GetOffsetFix 2004-02-20 04:16:12 +00:00
Glenn Maynard 036fd2beb9 Fix: don't chop off the first 26ms of each MP3 (but don't change sync,
either).
2003-10-02 04:56:09 +00:00
Glenn Maynard a5e6cd2787 Simplify.
Remove preloading; it's not useful.
2003-04-23 18:33:59 +00:00
Glenn Maynard e767641c67 Modularize preloading with a sound reader, so the !big logic
in RageSound can go away
2003-03-15 23:28:05 +00:00