ตั้งแต่วันที่ 27 มีนาคม 2025 เป็นต้นไป เราขอแนะนำให้ใช้ android-latest-release
แทน aosp-main
เพื่อสร้างและมีส่วนร่วมใน AOSP โปรดดูข้อมูลเพิ่มเติมที่หัวข้อการเปลี่ยนแปลงใน AOSP
เสียงความละเอียดสูง
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เวอร์ชัน Android 10 มีการปรับปรุงต่อไปนี้สำหรับเสียงความละเอียดสูง
- Float: อัปเดตตัวแปลงรหัสและโปรแกรมแยกไฟล์ WAV, FLAC เพื่อรองรับ Float (ความแม่นยำแบบไม่สูญเสียรายละเอียด 24 บิตขึ้นไป) เอฟเฟกต์การลดขนาดเสียงและ Virtualizer ได้รับการอัปเดตเป็นลอย
MediaPlayer (NuPlayer) อนุญาตให้ใช้ความแม่นยำที่อัปเดตแล้ว
- ความถี่สูง: อัปเดตตัวแปลงรหัสและโปรแกรมแยก WAV, FLAC เพื่อรองรับ 192 kHz
เอฟเฟกต์เริ่มต้นที่ Android มีให้ได้รับการทดสอบเพื่อรองรับ 192 kHz ที่ความถี่มาตรฐาน
ความถี่มาตรฐานที่อนุญาตคือ 88.2 kHz, 96 kHz, 176.4 kHz และ 192 kHz
- หลายช่อง: ระบบจะทดสอบเอฟเฟกต์การเล่นเริ่มต้นของ Android เพื่อรองรับเสียงหลายช่องได้สูงสุด 8 ช่อง
- ช่วงเวลา: ข้อมูลช่วงเวลาจะรวมอยู่ในเฟรมเวิร์กเสียง
ตั้งแต่ Android 9 เป็นต้นไป การปรับปรุงต่อไปนี้จะไม่ต้องติดตั้งใช้งานพาร์ทเนอร์
- จำนวนแทร็กเอาต์พุตไคลเอ็นต์พร้อมกันเพิ่มขึ้นจาก 14 เป็น 40 เนื่องจากอินสแตนซ์ไคลเอ็นต์ของ
AudioTrack
แบบจำกัดเป็นปัญหาสำหรับแอปใน Android 8.x
- หน่วยความจำสูงสุดของไคลเอ็นต์/เซิร์ฟเวอร์เพิ่มขึ้นจาก 4 MB เป็น 32 MB (ขึ้นอยู่กับหน่วยความจำทั้งหมดของอุปกรณ์) เพื่อให้เล่นแทร็กเสียงความละเอียดสูงพร้อมกันได้มากขึ้น
- แทร็กผสมทั้งหมดเพิ่มขึ้นจาก 32 เป็น 256 เพื่อป้องกันการช่วงชิงทรัพยากรระหว่างแอปและ UI ของระบบ
การเปลี่ยนแปลงเอฟเฟกต์เอาต์พุต
ดูเอฟเฟกต์เสียงสำหรับการเปลี่ยนแปลงในรุ่น Android 11
ก่อนการเปิดตัว Android 9 ได้มีการใช้การประมวลผลเชนเอฟเฟกต์ในรูปแบบตัวอย่าง int16 แบบสเตอริโอ ซึ่งมีข้อจํากัดหลายประการ ดังนี้
- เอฟเฟกต์เอาต์พุตทั้งหมดจะบังคับให้แปลงข้อมูลจากเสียงที่เป็นทศนิยมไปเป็นแบบ int16 ซึ่งทำให้ความแม่นยำลดลง
- ระบบปฏิเสธเอฟเฟกต์เอาต์พุตจากซิงค์เอาต์พุตที่มีจํานวนช่องมากกว่า 2
ในรุ่น Android 9 จะมีการอัปเกรดไปป์ไลน์การประมวลผลเชนเอฟเฟกต์เพื่อรองรับรูปแบบหลายช่องแบบลอย ประเด็นสำคัญ
- ระบบได้ย้ายข้อมูลเอฟเฟกต์ซอฟต์แวร์ของ Android ไปยังสเตอริโอแบบลอยตัวแล้ว
- เอฟเฟกต์เดิมจะใช้ได้กับอะแดปเตอร์รูปแบบ ซึ่งจะแปลง float เป็น int16 ตามที่จำเป็น
ใช้เอฟเฟกต์เอาต์พุต
การใช้งานอ้างอิงสำหรับเอฟเฟกต์เอาต์พุตมีอยู่ใน
frameworks/av/media/libeffects
พาร์ทเนอร์ที่ใช้เอฟเฟกต์เอาต์พุตที่กำหนดเองของตนเองควรทำดังนี้สำหรับรุ่น Android 10
- อัปเดตเอฟเฟกต์เอาต์พุตเพื่อรองรับรูปแบบ Float แบบหลายช่อง โดยทำดังนี้
- คุณไม่จําเป็นต้องรองรับการประมวลผล Int16 อีกต่อไป
- รองรับจำนวนช่องเอาต์พุต 2-8 (สำหรับความสามารถในการใช้งานร่วมกันในอนาคต ให้พิจารณาจำนวน 1-30)
- รองรับจำนวนช่องอินพุตที่ตรงกับจำนวนช่องเอาต์พุตสำหรับเอฟเฟกต์แทรก เสียงเอฟเฟกต์เสริมจะยังคงเห็นจำนวนช่องอินพุต 1 (โมโน)
- รองรับทั้งมาสก์ตำแหน่งช่อง (Canonical) และมาสก์ดัชนีช่องของ
(1 << n) - 1
- หากต้องรองรับเอฟเฟกต์เอาต์พุตของผู้ให้บริการเดิมต่อไปและอัปเดตไม่ได้ ให้ยืนยันโค้ดเดิมดังนี้
- เอฟเฟกต์เอาต์พุต (แทรก) แบบเดิมต้องปฏิเสธการกำหนดค่าที่ไม่รองรับใน
EFFECT_CMD_SET_CONFIG
- ตรวจสอบว่ารูปแบบเป็น int16
- ตรวจสอบว่าหน้ากากช่องอินพุตและเอาต์พุตเป็นแบบสเตอริโอ
- หากการตรวจสอบไม่สําเร็จ ให้แสดงผล
-EINVAL
- เอฟเฟกต์เอาต์พุต (เสริม) แบบเดิมได้รับการกำหนดค่าโดย AudioFlinger ด้วยมาสก์ช่องอินพุตโมโนและมาสก์ช่องเอาต์พุตที่อาจเป็นแบบหลายช่อง ทั้งนี้ขึ้นอยู่กับว่าตัวรับสัญญาณเอาต์พุตเป็นแบบหลายช่องหรือไม่
ผู้ขายต้องปฏิเสธการกำหนดค่าที่ไม่รองรับใน
EFFECT_CMD_SET_CONFIG
- ตรวจสอบว่ารูปแบบเป็น int16
- ตรวจสอบว่าหน้ากากช่องอินพุตเป็นแบบโมโนและหน้ากากช่องเอาต์พุตเป็นแบบสเตอริโอ
- หากการตรวจสอบไม่สําเร็จ ให้แสดงผล
-EINVAL
- ยืนยันโค้ดเดิม อย่าเพิ่งคิดว่าใช้งานได้
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-27 UTC
[[["เข้าใจง่าย","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-07-27 UTC"],[],[],null,["# High-resolution audio\n\nThe Android 10 release includes the following\nimprovements for high-resolution audio:\n\n- **Float:** WAV, FLAC codecs, and extractors are updated to support float (24+ bits of lossless precision). Downmix and Virtualizer effects are updated to float. Updated precision is allowed by MediaPlayer (NuPlayer).\n- **High-frequency:** WAV, FLAC codecs, and extractors are updated to support 192 kHz. The default Android supplied effects are tested for 192 kHz support at standard frequencies. The standard frequencies permitted are 88.2 kHz, 96 kHz, 176.4 kHz, and 192 kHz.\n- **Multichannel:** Default Android playback effects are tested for multichannel support to eight channels.\n- **Timing:** Timing information is included throughout the audio framework.\n\nStarting in Android 9, the following improvements\ndon't require any partner implementation:\n\n- The number of simultaneous client output tracks increases from 14 to 40, as limited client instances of `AudioTrack` have been an issue for apps in Android 8.x.\n- Maximum client/server memory increases from 4 MB to 32 MB (depending on total device memory) to allow more simultaneous high-resolution audio tracks.\n- Total mixed tracks increases from 32 to 256 to prevent resource contention between apps and the System UI.\n\nOutput effect changes\n---------------------\n\nSee [Audio\neffects](/docs/core/audio/audio-effects) for Android 11 release changes.\n\nPrior to the Android 9 release, effect chain processing\nwas implemented in stereo int16 sample format. This had several limitations:\n\n- All output effects forced conversion from floating point audio data to int16, causing loss of precision.\n- Output effects were rejected from output sinks with a channel count greater than two.\n\nIn the Android 9 release, the effect chain processing\npipeline is upgraded to support the multichannel float format. Key points:\n\n- Android software effects are already migrated to stereo float.\n- Legacy effects are supported with format adapters, which convert float to int16 as needed.\n\nImplement output effects\n------------------------\n\nA reference implementation for output effects is available under\n`frameworks/av/media/libeffects`.\n\nPartners implementing their own custom output effects should do the\nfollowing for the Android 10 release:\n\n- Update output effects to support the multichannel float format:\n - Int16 processing support is no longer required.\n - Support output channel counts from 2--8 (for future compatibility consider counts from 1--30).\n - Support input channel counts matching output channel counts for insert effects. Auxiliary effects continue to see an input channel count of 1 (mono).\n - Support both channel position masks (canonical) and channel index masks of `(1 \u003c\u003c n) - 1`.\n- If you must continue to support legacy vendor output effects and can't update them, then verify legacy code as follows:\n - Legacy output (insert) effects **must reject** unsupported configurations in `EFFECT_CMD_SET_CONFIG`.\n - Check that the format is int16.\n - Check that the input and output channel masks are stereo.\n - If either check fails, return `-EINVAL`.\n - Legacy output (auxiliary) effects are configured by AudioFlinger with a mono input channel mask and potentially multichannel output channel masks, depending on whether the output sink is multichannel. They **must reject** unsupported configurations in `\n EFFECT_CMD_SET_CONFIG`.\n - Check that the format is int16.\n - Check that the input channel mask is mono and the output channel mask is stereo.\n - If either check fails, return `-EINVAL`.\n - Verify legacy code. Don't assume that it works!"]]