اعتبارًا من 27 آذار (مارس) 2025، ننصحك باستخدام android-latest-release بدلاً من aosp-main لإنشاء AOSP والمساهمة فيه. لمزيد من المعلومات، يُرجى الاطّلاع على التغييرات في AOSP.
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
يتضمّن إصدار Android 10 المتطلبات التالية
لالتقاط الصور باستخدام VOICE_COMMUNICATION.
يجب أن توفّر عمليات التنفيذ ميزة إلغاء الصدى الصوتي (AEC) في مسار الالتقاط عند
الالتقاط باستخدام VOICE_COMMUNICATION.
في حال توفير ميزة "إلغاء الصدى"، يجب أن تكون قابلة للاكتشاف والتحكّم فيها من خلال AcousticEchoCanceler في واجهة برمجة تطبيقات حزمة تطوير البرامج (SDK).
توفّر منصة Android تأثيرات صوتية على الأجهزة المتوافقة في حزمة
audiofx، والتي يمكن للمطوّرين الوصول إليها.
على سبيل المثال، يتيح جهاز Nexus 10 تأثيرات المعالجة المسبقة التالية:
يتم إقران تأثيرات المعالجة المسبقة بوضع حالة الاستخدام الذي يتم فيه طلب المعالجة المسبقة. في تطوير تطبيقات Android، يُشار إلى حالة الاستخدام
بصفتها مثيل AudioSource، ويطلب مطوّرو التطبيقات استخدام
تصنيف AudioSource بدلاً من جهاز الأجهزة الصوتية
الفعلي. يربط "مدير سياسة الصوت" في Android مثيل AudioSource بأحد ملفّات تكوين مسار الالتقاط (بما في ذلك الجهاز والكسب والمعالجة المسبقة) وفقًا
للقواعد الخاصة بالمنتج. تتوفّر المصادر التالية للمطوّرين:
يتم تحديد تأثيرات المعالجة المُسبَقة التلقائية التي يتم تطبيقها على كل مثيل من AudioSource
في ملف /vendor/etc/audio_effects.xml. لتحديد تأثيراتك التلقائية لكل مثيل من AudioSource، أنشئ ملفًا من نوع
/vendor/etc/audio_effects.xml وحدِّد تأثيرات pre-processing (المعالجة المُسبَقة) المطلوب تفعيلها. على سبيل المثال، يمكنك الاطّلاع على عملية التنفيذ لجهاز
Nexus 10 في device/samsung/manta/audio_effects.xml.
تحصل نُسخ AudioEffect على جلسة وتُطلقها عند إنشائها وإزالتها،
ما يتيح استمرار التأثيرات (مثل "مُحسِّن الصوت") طوال
الجلسة.
يُمكِّن المثال التالي من معالجة ما قبل التشغيل لمثيلَي VoIP
AudioSource وكاميرا الفيديو AudioSource. من خلال تحديد
إعدادات AudioSource بهذه الطريقة، يطلب الإطار
تلقائيًا استخدام هذه التأثيرات من HAL.
لا تفرض عملية ضبط AudioSource متطلبات صريحة على معالجة ملف صوتي
أو تحسينه، باستثناء ميزة التعرّف على الصوت
(VOICE_RECOGNITION). تشمل متطلبات ميزة التعرّف على الصوت ما يلي:
استجابة تردد منتظمة (+/- 3 ديسيبل) من 100 هرتز إلى 4 كيلوهرتز
إعدادات المحادثات القريب: 90 ديسيبل قياس مستوى الضغط الصوتي (SPL) يقرأ ذروة متوسط الطاقة (RMS) 2500 (عيّنات 16 بت)
يتتبّع المستوى القيمة بشكل خطي من -18 ديسيبل إلى +12 ديسيبل بالنسبة إلى 90 ديسيبل SPL
نسبة THD أقل من %1 (90 ديسيبل SPL في نطاق من 100 إلى 4000 هرتز)
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-06-12 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-06-12 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# Configure preprocessing effects\n\nThe Android 10 release includes the following\nrequirements for capture with `VOICE_COMMUNICATION`.\n\n- Implementations should provide an acoustic echo canceler (AEC) on the capture path when capturing with `VOICE_COMMUNICATION`.\n- If providing an AEC, it must be discoverable and controllable through the SDK API's `AcousticEchoCanceler`.\n\nThe Android platform provides audio effects on supported devices in the\n[`audiofx`](http://developer.android.com/reference/android/media/audiofx/package-summary.html) package, which is available for developers to access.\nFor example, the Nexus 10 supports the following preprocessing effects:\n\n- [Acoustic\n Echo Cancellation](http://developer.android.com/reference/android/media/audiofx/AcousticEchoCanceler.html)\n- [Automatic Gain Control](http://developer.android.com/reference/android/media/audiofx/AutomaticGainControl.html)\n- [Noise\n Suppression](http://developer.android.com/reference/android/media/audiofx/NoiseSuppressor.html)\n\nPair with AudioSource instances\n-------------------------------\n\nPreprocessing effects are paired with the use case mode in which the\npreprocessing is requested. In Android app development, a use case is referred\nto as an `AudioSource` instance; and app developers request to use the\n`AudioSource` abstraction instead of the actual audio hardware\ndevice. The Android Audio Policy Manager maps an `AudioSource` instance to a\ngiven capture path configuration (including device, gain, and pre processing) according\nto product-specific rules. The following sources are exposed to developers:\n\n- `android.media.MediaRecorder.AudioSource.CAMCORDER`\n- `android.media.MediaRecorder.AudioSource.VOICE_COMMUNICATION`\n- `android.media.MediaRecorder.AudioSource.VOICE_CALL`\n- `android.media.MediaRecorder.AudioSource.VOICE_DOWNLINK`\n- `android.media.MediaRecorder.AudioSource.VOICE_UPLINK`\n- `android.media.MediaRecorder.AudioSource.VOICE_RECOGNITION`\n- `android.media.MediaRecorder.AudioSource.MIC`\n- `android.media.MediaRecorder.AudioSource.DEFAULT`\n\nThe default preprocessing effects applied for each `AudioSource` instance\nare specified in the `/vendor/etc/audio_effects.xml` file. To\nspecify your own default effects for every `AudioSource` instance, create a\n`/vendor/etc/audio_effects.xml` file and specify the\npreprocessing effects to turn on. For an example, see the implementation for\nthe Nexus 10 in `device/samsung/manta/audio_effects.xml`.\n`AudioEffect` instances acquire and release a session when created and destroyed,\nenabling the effects (such as the Loudness Enhancer) to persist throughout the\nsession.\n| **Warning:** For the `VOICE_RECOGNITION` use case, don't enable the noise suppression preprocessing effect. It shouldn't be turned on by default when recording from this audio source, and you shouldn't enable it in your own `audio_effects.xml` file. Turning on the effect by default causes the device to fail the [compatibility requirement](/docs/compatibility) regardless of whether this was on by default due to the configuration file, or the audio HAL implementation's default behavior.\n\nThe following example enables preprocessing for the VoIP\n`AudioSource` and Camcorder `AudioSource` instances. By declaring\nthe `AudioSource` configuration in this manner, the framework\nautomatically requests the use of those effects from the HAL. \n\n```carbon\n\u003cpreprocess\u003e\n \u003cstream type=\"voice_communication\"\u003e\n \u003capply effect=\"aec\"/\u003e\n \u003capply effect=\"ns\"/\u003e\n \u003c/stream\u003e\n \u003cstream type=\"camcorder\"\u003e\n \u003capply effect=\"agc\"/\u003e\n \u003c/stream\u003e\n \u003c/preprocess\u003e\n```\n\nSource tuning\n-------------\n\n`AudioSource` tuning doesn't have explicit requirements on audio\ngain or audio processing with the exception of voice recognition\n(`VOICE_RECOGNITION`). Requirements for voice recognition include:\n\n- Flat frequency response (+/- 3 dB) from 100 Hz to 4 kHz\n- Close-talk config: 90 dB SPL reads RMS of 2500 (16 bit samples)\n- Level tracks linearly from -18 dB to +12 dB relative to 90 dB SPL\n- THD \\\u003c 1% (90 dB SPL in 100 to 4000 Hz range)\n- Near-ultrasound requirements (for testing, see [Near Ultrasound\n Tests](/docs/compatibility/cts/near-ultrasound)):\n - Support for `SUPPORT_PROPERTY_MIC_NEAR_ULTRASOUND` as defined in section 7.8.3 of the CDD.\n - Support for one or both of 44100 or 48000 sampling rates with no band-pass or antialiasing filters.\n- Effects/preprocessing disabled by default\n\nExamples of tuning different effects for different sources are:\n\n- Noise Suppressor\n - Tuned for wind noise suppressor for `CAMCORDER`\n - Tuned for stationary noise suppressor for `VOICE_COMMUNICATION`\n- Automatic Gain Control\n - Tuned for close-talk for `VOICE_COMMUNICATION` and main phone mic\n - Tuned for far-talk for `CAMCORDER`\n\nResources\n---------\n\nFor more information, refer to the following resources:\n\n- Android documentation for [audiofx\n package](http://developer.android.com/reference/android/media/audiofx/package-summary.html)\n- Android documentation for [Noise\n Suppression audio effect](http://developer.android.com/reference/android/media/audiofx/NoiseSuppressor.html)\n- `/device/google/crosshatch/audio_effects.xml` file for the Pixel 3"]]