From b69847cf6416d711f3f1f4ec2871364125bff925 Mon Sep 17 00:00:00 2001 From: Phil Burk Date: Fri, 23 Aug 2019 17:33:28 -0700 Subject: resampler: add Fastest quality It will use a bi-linear interpolation. Also cleanup FullDuplexEcho --- include/oboe/AudioStreamBuilder.h | 11 ++++++----- include/oboe/Definitions.h | 12 ++++++++++-- 2 files changed, 16 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/oboe/AudioStreamBuilder.h b/include/oboe/AudioStreamBuilder.h index 092d1773..4e1dad74 100644 --- a/include/oboe/AudioStreamBuilder.h +++ b/include/oboe/AudioStreamBuilder.h @@ -341,12 +341,13 @@ public: } /** - * If set to None then Oboe will not do sample rate conversion. But the underlying APIs - * might do sample rate conversion. Unfortunately sample rate conversion in Android typically - * prevents one from getting a low latency stream. So we can do the conversion in Android - * and still get a low latency stream. + * Specify the quality of the sample rate converter in Oboe. * - * Default is SampleRateConversionType::Sinc. TODO currently Linear + * If set to None then Oboe will not do sample rate conversion. But then the underlying APIs + * might do sample rate conversion, which can prevent one from getting a low latency stream. + * If we do the conversion in Oboe then we can still get a low latency stream. + * + * Default is SampleRateConversionQuality::None */ AudioStreamBuilder *setSampleRateConversionQuality(SampleRateConversionQuality quality) { mSampleRateConversionQuality = quality; diff --git a/include/oboe/Definitions.h b/include/oboe/Definitions.h index 29fd55d1..b1ea7f13 100644 --- a/include/oboe/Definitions.h +++ b/include/oboe/Definitions.h @@ -228,18 +228,26 @@ namespace oboe { }; /** - * The algorithm used to perform sample rate conversion. + * Specifies the quality of the sample rate conversion performed by Oboe. * Higher quality will require more CPU load. + * Higher quality conversion will probably be implemented using a sinc based resampler. */ enum class SampleRateConversionQuality : int32_t { /** * No conversion by Oboe. Underlying APIs may still do conversion. */ None, - + /** + * Fastest conversion but may not sound great. + * This may be implemented using bilinear interpolation. + */ + Fastest, Low, Medium, High, + /** + * Highest quality conversion, which may be expensive in terms of CPU. + */ Best, }; -- cgit v1.2.3