summaryrefslogtreecommitdiffstats
path: root/include/media/AudioResamplerPublic.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/media/AudioResamplerPublic.h')
-rw-r--r--include/media/AudioResamplerPublic.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/media/AudioResamplerPublic.h b/include/media/AudioResamplerPublic.h
index 53b8c13..6cf2ca9 100644
--- a/include/media/AudioResamplerPublic.h
+++ b/include/media/AudioResamplerPublic.h
@@ -143,6 +143,16 @@ static inline size_t sourceFramesNeededWithTimestretch(
return required * (double)speed + 1 + 1; // accounting for rounding dependencies
}
+// Identifies sample rates that we associate with music
+// and thus eligible for better resampling and fast capture.
+// This is somewhat less than 44100 to allow for pitch correction
+// involving resampling as well as asynchronous resampling.
+#define AUDIO_PROCESSING_MUSIC_RATE 40000
+
+static inline bool isMusicRate(uint32_t sampleRate) {
+ return sampleRate >= AUDIO_PROCESSING_MUSIC_RATE;
+}
+
} // namespace android
// ---------------------------------------------------------------------------