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

Commit 3724095f authored by Eric Laurent's avatar Eric Laurent Committed by Android (Google) Code Review
Browse files

Merge "add new audio sources for audio capture"

parents 25d3eb57 ae4b6ecf
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -373,6 +373,13 @@ enum {
     * so the recorded volume may be very low.
     */
    AAUDIO_INPUT_PRESET_UNPROCESSED = 9,

    /**
     * Use this preset for capturing audio meant to be processed in real time
     * and played back for live performance (e.g karaoke).
     * The capture path will minimize latency and coupling with playback path.
     */
    AAUDIO_INPUT_PRESET_VOICE_PERFORMANCE = 10,
};
typedef int32_t aaudio_input_preset_t;

+1 −0
Original line number Diff line number Diff line
@@ -158,6 +158,7 @@ aaudio_result_t AAudioStreamParameters::validate() const {
        case AAUDIO_INPUT_PRESET_VOICE_COMMUNICATION:
        case AAUDIO_INPUT_PRESET_VOICE_RECOGNITION:
        case AAUDIO_INPUT_PRESET_UNPROCESSED:
        case AAUDIO_INPUT_PRESET_VOICE_PERFORMANCE:
            break; // valid
        default:
            ALOGE("input preset not valid = %d", mInputPreset);
+1 −0
Original line number Diff line number Diff line
@@ -210,6 +210,7 @@ audio_source_t AAudioConvert_inputPresetToAudioSource(aaudio_input_preset_t pres
    STATIC_ASSERT(AAUDIO_INPUT_PRESET_VOICE_RECOGNITION == AUDIO_SOURCE_VOICE_RECOGNITION);
    STATIC_ASSERT(AAUDIO_INPUT_PRESET_VOICE_COMMUNICATION == AUDIO_SOURCE_VOICE_COMMUNICATION);
    STATIC_ASSERT(AAUDIO_INPUT_PRESET_UNPROCESSED == AUDIO_SOURCE_UNPROCESSED);
    STATIC_ASSERT(AAUDIO_INPUT_PRESET_VOICE_PERFORMANCE == AUDIO_SOURCE_VOICE_PERFORMANCE);
    if (preset == AAUDIO_UNSPECIFIED) {
        preset = AAUDIO_INPUT_PRESET_VOICE_RECOGNITION;
    }
+1 −0
Original line number Diff line number Diff line
@@ -130,6 +130,7 @@ static const aaudio_input_preset_t sInputPresets[] = {
    AAUDIO_INPUT_PRESET_VOICE_RECOGNITION,
    AAUDIO_INPUT_PRESET_VOICE_COMMUNICATION,
    AAUDIO_INPUT_PRESET_UNPROCESSED,
    AAUDIO_INPUT_PRESET_VOICE_PERFORMANCE,
};

static void checkAttributesUsage(aaudio_performance_mode_t perfMode) {
+1 −0
Original line number Diff line number Diff line
@@ -115,6 +115,7 @@ constexpr std::pair<audio_source_t, const char*> STREAM_NAME_MAP<audio_source_t>
        {AUDIO_SOURCE_VOICE_RECOGNITION, "voice_recognition"},
        {AUDIO_SOURCE_VOICE_COMMUNICATION, "voice_communication"},
        {AUDIO_SOURCE_UNPROCESSED, "unprocessed"},
        {AUDIO_SOURCE_VOICE_PERFORMANCE, "voice_performance"},
};

/** Find the stream type enum corresponding to the stream type name or return false */
Loading