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

Commit 87c9ee8b authored by Phil Burk's avatar Phil Burk Committed by android-build-merger
Browse files

aaudio: return channelCount in legacy stream am: a5247769

am: bfa6c20f

Change-Id: I863862980f48f5f208b41448833b8144e9c7aa49
parents 39e88a61 bfa6c20f
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ aaudio_result_t AudioStreamRecord::open(const AudioStreamBuilder& builder)

    // Try to create an AudioRecord

    // TODO Support UNSPECIFIED in AudioTrack. For now, use stereo if unspecified.
    // TODO Support UNSPECIFIED in AudioRecord. For now, use stereo if unspecified.
    int32_t samplesPerFrame = (getSamplesPerFrame() == AAUDIO_UNSPECIFIED)
                              ? 2 : getSamplesPerFrame();
    audio_channel_mask_t channelMask = audio_channel_in_mask_from_count(samplesPerFrame);
@@ -130,8 +130,8 @@ aaudio_result_t AudioStreamRecord::open(const AudioStreamBuilder& builder)
        return AAudioConvert_androidToAAudioResult(status);
    }

    // Get the actual rate.
    setSampleRate(mAudioRecord->getSampleRate());
    // Get the actual values from the AudioRecord.
    setSamplesPerFrame(mAudioRecord->channelCount());
    setFormat(AAudioConvert_androidToAAudioDataFormat(mAudioRecord->format()));

    int32_t actualSampleRate = mAudioRecord->getSampleRate();