From db4c031f518ae5806af73756273ff32cd8d0e4f8 Mon Sep 17 00:00:00 2001 From: Andy Hung Date: Wed, 6 May 2015 08:46:52 -0700 Subject: Update sampling rate to 192kHz for devices Change-Id: I0a83206be51d7ae18ccf85b94b2127356307be69 --- include/media/AudioResamplerPublic.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/media/AudioResamplerPublic.h') 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 // --------------------------------------------------------------------------- -- cgit v1.1