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

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

aaudio: return channelCount in legacy stream

am: a5247769

Change-Id: Ia6679fb05f311c564b7c4c87ed82311374a0fc17
parents b66815f3 a5247769
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();