از 27 مارس 2025، توصیه می کنیم از android-latest-release به جای aosp-main برای ساختن و کمک به AOSP استفاده کنید. برای اطلاعات بیشتر، به تغییرات AOSP مراجعه کنید.
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
نسخه Android 10 شامل شرایط زیر برای ضبط با VOICE_COMMUNICATION است.
هنگام عکسبرداری با VOICE_COMMUNICATION پیادهسازیها باید یک لغو کننده اکو آکوستیک (AEC) در مسیر عکسبرداری ارائه کنند.
در صورت ارائه AEC، باید از طریق AcousticEchoCanceler SDK API قابل کشف و کنترل باشد.
پلتفرم اندروید افکت های صوتی را بر روی دستگاه های پشتیبانی شده در بسته audiofx ارائه می دهد که برای توسعه دهندگان در دسترس است. به عنوان مثال، Nexus 10 از جلوه های پیش پردازش زیر پشتیبانی می کند:
جلوه های پیش پردازش با حالت کاربرد موردی که در آن پیش پردازش درخواست می شود جفت می شود. در توسعه برنامه اندروید، یک مورد استفاده به عنوان نمونه AudioSource نامیده می شود. و توسعه دهندگان برنامه درخواست می کنند که به جای دستگاه سخت افزار صوتی واقعی از انتزاع AudioSource استفاده کنند. مدیر خط مشی صوتی Android، یک نمونه AudioSource را به پیکربندی مسیر ضبط داده شده (شامل دستگاه، بهره، و پردازش اولیه) مطابق با قوانین خاص محصول ترسیم می کند. منابع زیر در معرض توسعه دهندگان قرار می گیرند:
جلوه های پیش پردازش پیش فرض اعمال شده برای هر نمونه AudioSource در فایل /vendor/etc/audio_effects.xml مشخص شده است. برای مشخص کردن افکتهای پیشفرض خود برای هر نمونه AudioSource ، یک فایل /vendor/etc/audio_effects.xml ایجاد کنید و جلوههای پیشپردازش را برای روشن کردن مشخص کنید. برای مثال، اجرای Nexus 10 را در device/samsung/manta/audio_effects.xml ببینید. نمونههای AudioEffect زمانی که ایجاد و از بین میروند، یک جلسه را میگیرند و آزاد میکنند و این امکان را فراهم میکنند که اثرات (مانند تقویتکننده بلندی صدا) در طول جلسه باقی بمانند.
مثال زیر پیش پردازش را برای نمونه های VoIP AudioSource و Camcorder AudioSource فعال می کند. با اعلام پیکربندی AudioSource به این روش، فریم ورک به طور خودکار استفاده از آن جلوه ها را از HAL درخواست می کند.
فایل /device/google/crosshatch/audio_effects.xml برای Pixel 3
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و OpenJDK علامتهای تجاری یا علامتهای تجاری ثبتشده Oracle و/یا وابستههای آن هستند.
تاریخ آخرین بهروزرسانی 2025-06-12 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","easyToUnderstand","thumb-up"],["مشکلم را برطرف کرد","solvedMyProblem","thumb-up"],["غیره","otherUp","thumb-up"]],[["اطلاعاتی که نیاز دارم وجود ندارد","missingTheInformationINeed","thumb-down"],["بیشازحد پیچیده/ مراحل بسیار زیاد","tooComplicatedTooManySteps","thumb-down"],["قدیمی","outOfDate","thumb-down"],["مشکل ترجمه","translationIssue","thumb-down"],["مشکل کد / نمونهها","samplesCodeIssue","thumb-down"],["غیره","otherDown","thumb-down"]],["تاریخ آخرین بهروزرسانی 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"]]