Commit Graph
21 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 00f371fa7c remove IsStreamingFromDisk 2006-12-23 07:15:32 +00:00
Glenn Maynard 55e3391b4f this filter doesn't propagate errors; an error in one sound doesn't kill the rest 2006-12-23 06:57:16 +00:00
Glenn Maynard 5bb87d4eff add GetNumSounds 2006-12-22 05:27:25 +00:00
Glenn Maynard ef5c5e20c1 SetPosition 2006-12-10 09:01:05 +00:00
Glenn Maynard 2f1782d892 merge Read and ReadBlock 2006-12-10 05:41:41 +00:00
Glenn Maynard 9a55b8d28a remove unused 2006-12-10 05:18:33 +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 84c5c0a865 Simplify RSR_Chain. Allow passing in sound readers directly.
If all sounds have one channel and nothing pans, keep one channel.
Use RSR_Pan.
2006-12-09 22:40:39 +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 0e72d6d08c cosmetic 2006-12-09 03:40:55 +00:00
Glenn Maynard f41362f7a9 SoundReader -> RageSoundReader 2006-11-30 04:19:51 +00:00
Glenn Maynard 630c84d0c1 SetProperty 2006-11-30 02:52:41 +00:00
Glenn Maynard 8542b7d190 GetNextStreamFrame -> GetNextSourceFrame 2006-11-29 21:52:31 +00:00
Glenn Maynard e3b98efd66 GetNextStreamFrame, GetStreamToSourceRatio implementations 2006-11-29 08:15:22 +00:00
Glenn Maynard 7a95f5da5b covariant Copy() 2006-10-20 00:01:18 +00:00
Chris Danford 7f821e8cfc CString -> RString 2006-01-22 01:00:06 +00:00
Glenn Maynard c21d4c2756 simplify a bit, optimize 2004-10-28 05:10:47 +00:00
Glenn Maynard 206ce1aa0b stop going to lengths to avoid copying sounds in the BGM; copying
needs to be fast, anyway
2004-10-26 19:10:57 +00:00
Glenn Maynard 0d37465667 Add RageSoundReader_Chain. 2004-10-25 00:53:17 +00:00