Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit da390c1a authored by Nikhil Bhanu's avatar Nikhil Bhanu Committed by Akshay Cadambi
Browse files

Disable spatialization when audio content type is speech.

Test: play podcast content on spotify and audible
Bug: 385389997
Flag: com.android.media.audio.stereo_spatialization
Change-Id: I5a2e48e5ef5edcc5aa3f330fabdccfa7d0dc1976
parent b92d9691
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -6617,11 +6617,14 @@ bool AudioPolicyManager::canBeSpatializedInt(const audio_attributes_t *attr,
        if (!audio_is_linear_pcm(config->format)) {
            return false;
        }
        if (config->channel_mask == AUDIO_CHANNEL_OUT_STEREO
                && ((attr->flags & AUDIO_FLAG_LOW_LATENCY) != 0)) {
        if (config->channel_mask == AUDIO_CHANNEL_OUT_STEREO) {
            if (attr != nullptr &&
                (((attr->flags & AUDIO_FLAG_LOW_LATENCY) != 0) ||
                (attr->content_type == AUDIO_CONTENT_TYPE_SPEECH))) {
                return false;
            }
        }
    }

    sp<IOProfile> profile =
            getSpatializerOutputProfile(config, devices);