fix: fix sample rate bug for Android on Unity 6000 or newer.#133
Open
cloudwebrtc wants to merge 1 commit intomainfrom
Open
fix: fix sample rate bug for Android on Unity 6000 or newer.#133cloudwebrtc wants to merge 1 commit intomainfrom
cloudwebrtc wants to merge 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR extends the microphone sample rate override to Android when building with Unity 6.0.0 or newer and updates the inline comment to reflect that change.
- Include Android (Unity 6.0+) in the
DefaultMicrophoneSampleRatepreprocessor condition - Update comment to mention both iOS and Android sample rates
Comments suppressed due to low confidence (2)
Runtime/Scripts/RtcAudioSource.cs:36
- [nitpick] Clarify the comment to reference a valid Unity version macro and platform, for example:
// iOS and Android (Unity 2020.3 or newer) microphone sample rate is 24 kHz.
// iOS/Android(Unity 6000+) microphone sample rate is 24k
Runtime/Scripts/RtcAudioSource.cs:37
- [nitpick] Add unit or integration tests to verify that
DefaultMicrophoneSampleRateresolves to 24000 in both iOS and Android builds (with and withoutUNITY_EDITOR) to prevent regressions.
public static uint DefaultMicrophoneSampleRate = 24000;
Comment on lines
+35
to
+36
| #if (UNITY_IOS || (UNITY_ANDROID && UNITY_6000_0_OR_NEWER)) && !UNITY_EDITOR | ||
| // iOS/Android(Unity 6000+) microphone sample rate is 24k |
There was a problem hiding this comment.
The preprocessor symbol UNITY_6000_0_OR_NEWER does not correspond to any existing Unity version macro, so this block will never compile for Android. Use the correct Unity version define (e.g., UNITY_2020_3_OR_NEWER or another valid version) to ensure the Android path is enabled.
Suggested change
| #if (UNITY_IOS || (UNITY_ANDROID && UNITY_6000_0_OR_NEWER)) && !UNITY_EDITOR | |
| // iOS/Android(Unity 6000+) microphone sample rate is 24k | |
| #if (UNITY_IOS || (UNITY_ANDROID && UNITY_2020_3_OR_NEWER)) && !UNITY_EDITOR | |
| // iOS/Android(Unity 2020.3+) microphone sample rate is 24k |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
close #132