Commit Graph

22 Commits

Author SHA1 Message Date
wangqr 5f326cc873 Correctly write float header when saving WAV audio clip
Fix wangqr/Aegisub#56
2020-06-29 04:57:55 -04:00
wangqr 71894fd769 Fix bugs in ram audio provider
There was some magic bit operations to calculate the cache block offsets. This only works when both bytes_per_sample and channels are power of 2. Originally the format is assumed to be int16 mono, which satisfies this requirement. However in case we use original audio data, the channels can be something not a power of 2 (e.g. for 5.1 channel audio the number of channels is 6). This will break the calculation. We rewrite the calculation, without using those bit operations.
2019-11-02 02:26:36 -04:00
wangqr 56434c5f58 Fix bugs in separating Int16Mono and original audio
* A memory leak in FillBufferInt16Mono
* A now unnecessary assert
2019-11-02 00:41:14 -04:00
wangqr 0336779735 Added experimental XAudio2 audio player
Removed downsampling in FFMS2 and CreateConvertAudioProvider, to ensure we can get the original audio channels and data.

Fix Aegisub/Aegisub#160
2019-11-01 03:32:42 -04:00
wangqr 620033915a Handle channel > 1 in hd & ram cache audio provider 2019-10-30 00:47:45 -04:00
wangqr c1a4e0674b Move the ConvertAudioProvider into GetInt16MonoAudio function
And use a dummy ConvertAudioProvider to keep backward compatibility.
2019-10-30 00:19:10 -04:00
wangqr 24d52bb1ee Clearly state int16 Mono of the audio provider in function name
Most code assumes the audio provider is providing int16 single channel audio data, without actually checking them. In this commit, we add a new function to provide the needed int16 mono data with checking.
2019-10-29 21:45:40 -04:00
wangqr f1ef3d2d2c Fix PCM provider bugs 2019-09-15 19:46:43 -04:00
wangqr 1204a3be85 Cleanup CMake 2019-09-10 01:37:48 -04:00
wangqr c2c44f1ad2 Fix build warnings
For pimpl with anonymous namespace, see https://stackoverflow.com/questions/39684438
2019-09-07 01:31:16 -04:00
Thomas Goyne bebc024fa0 Fix overflow issues with truncated pcm files 2015-11-29 20:11:14 -08:00
Thomas Goyne 263ccbdc23 Fix misalined pointer read in the PCM audio provider 2015-11-29 20:11:14 -08:00
Thomas Goyne fefa31eb47 Improve code coverage of tests 2015-07-28 14:30:03 -07:00
Niels Martin Hansen ca555359d9 Make dummy audio provider generate non-periodic noise 2015-01-14 00:21:22 +01:00
Thomas Goyne 897f9d1254 Eliminate some warnings 2014-07-14 10:10:22 -07:00
Thomas Goyne 97c59e2630 Fix non-pch compilation 2014-07-14 10:10:22 -07:00
Thomas Goyne bffbae0ed9 Fix vc++ compilation 2014-07-10 12:55:38 -07:00
Thomas Goyne a5c2ef273f Add tests for floating point sample conversion 2014-07-10 11:44:56 -07:00
Thomas Goyne f32bdff84a Add tests for the sample doubling converter and make it work correctly 2014-07-10 11:44:56 -07:00
Thomas Goyne 93ad15efb1 Reuse the decoding buffer in the audio converters 2014-07-10 11:44:56 -07:00
Thomas Goyne b9c75d8706 Add tests for the audio bitdepth conversions
And fix some bugs in it, and make it not rely on undefined behavior.
2014-07-10 11:44:56 -07:00
Thomas Goyne 585e9489d9 Move some of the audio provider machinery to libaegisub
And add tests.
2014-07-10 11:44:56 -07:00