aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPhil Burk <philburk@google.com>2019-08-23 17:33:28 -0700
committerPhil Burk <philburk@google.com>2019-08-23 17:33:28 -0700
commitb69847cf6416d711f3f1f4ec2871364125bff925 (patch)
treee760aa198cc375e82d811cb6cc21ed51d255dd0a /include
parent99c00483810f46db61d9a729f90f551d0f7c03f8 (diff)
downloadoboe-b69847cf6416d711f3f1f4ec2871364125bff925.tar.gz
resampler: add Fastest quality
It will use a bi-linear interpolation. Also cleanup FullDuplexEcho
Diffstat (limited to 'include')
-rw-r--r--include/oboe/AudioStreamBuilder.h11
-rw-r--r--include/oboe/Definitions.h12
2 files changed, 16 insertions, 7 deletions
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,
};