OpenSL ES
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
คำเตือน: OpenSL ES เลิกใช้งานแล้ว นักพัฒนาซอฟต์แวร์ควรใช้ไลบรารี Oboe แบบโอเพนซอร์สซึ่งมีอยู่ใน GitHub
โอโบเป็น Wrapper ของ C++ ที่มี API คล้ายคลึงกัน
AAudio โอโบเรียก AAudio เมื่อ AAudio เป็น
ว่าง และจะกลับไปใช้ OpenSL ES หาก AAudio ไม่พร้อมใช้งาน
แพ็กเกจ NDK ประกอบด้วยการติดตั้งใช้งานเฉพาะสำหรับ Android
OpenSL ESTM API 1.0.1
ข้อมูลจำเพาะจาก Khronos Group
ไลบรารีนี้ให้คุณใช้ C หรือ C++ เพื่อใช้เสียงประสิทธิภาพสูงที่มีเวลาในการตอบสนองต่ำ ไม่ว่าจะเป็น
คุณกำลังเขียนโปรแกรมสังเคราะห์ เวิร์กสเตชันสำหรับเสียงดิจิทัล คาราโอเกะ เกม
หรือแอปอื่นๆ แบบเรียลไทม์
มาตรฐาน OpenSL ESTM แสดงฟีเจอร์ด้านเสียง
คล้ายกับที่ระบุไว้ใน MediaPlayer
และ MediaRecorder
API ในเฟรมเวิร์ก Android Java OpenSL ES มีอินเทอร์เฟซภาษา C และ
การเชื่อมโยง C++ ซึ่งช่วยให้คุณสามารถเรียกใช้ API จากโค้ดที่เขียนด้วยภาษาใดภาษาหนึ่ง
OpenSL ES API พร้อมช่วยคุณพัฒนาและปรับปรุงประสิทธิภาพเสียงของแอปได้
ส่วนหัว OpenSL ES มาตรฐาน <SLES/OpenSLES.h> และ
<SLES/OpenSLES_Platform.h> อนุญาตอินพุตและเอาต์พุตเสียง ข้อมูลเพิ่มเติม
ฟังก์ชันการทำงานเฉพาะของ Android อยู่ใน <SLES/OpenSLES_Android.h> และ
<SLES/OpenSLES_AndroidConfiguration.h>
ส่วนนี้เริ่มต้นด้วยการอธิบาย
วิธีผสาน OpenSL ES ไว้ในแอป
ต่อไป จะอธิบายถึงสิ่งที่คุณจำเป็นต้องทราบ
เกี่ยวกับการใช้งาน OpenSL ES สำหรับ Android โดยเน้นที่
ความแตกต่างระหว่างการติดตั้งใช้งานกับ
ข้อกำหนดอ้างอิง จากนั้น
ส่วนขยายเพิ่มเติม
สำหรับความเข้ากันได้กับ Android ส่วนนี้ปิดท้ายด้วยส่วนเสริม
หมายเหตุการเขียนโปรแกรมเพื่อให้แน่ใจว่า
การนำ OpenSL ES มาใช้
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 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-26 UTC"],[],[],null,["# OpenSL ES\n\nWARNING: OpenSL ES is **deprecated** . Developers should use the open source\nOboe library which is available on [GitHub](https://github.com/google/oboe).\nOboe is a C++ wrapper that provides an API that closely resembles\n[AAudio](/ndk/guides/audio/aaudio/aaudio). Oboe calls AAudio when AAudio is\navailable, and falls back to OpenSL ES if AAudio is not available.\n\nThe NDK package includes an Android-specific implementation of the\n[OpenSL ES™](https://www.khronos.org/opensles/) 1.0.1 API\nspecification from the [Khronos Group](https://www.khronos.org).\nThis library lets you use C or C++ to implement high-performance, low-latency audio, whether\nyou are writing a synthesizer, digital audio workstation, karaoke, game,\nor other real-time app.\n\n\nThe OpenSL ES™ standard exposes audio features\nsimilar to those in the [MediaPlayer](/reference/android/media/MediaPlayer) and [MediaRecorder](/reference/android/media/MediaRecorder)\nAPIs in the Android Java framework. OpenSL ES provides a C language interface as well as\nC++ bindings, allowing you to call the API from code written in either language.\n\n\nThe OpenSL ES APIs are available to help you develop and improve your app's audio performance.\n\n\nThe standard OpenSL ES headers \\\u003cSLES/OpenSLES.h\\\u003e and\n\\\u003cSLES/OpenSLES_Platform.h\\\u003e allow audio input and output. Additional\nAndroid-specific functionality is in \\\u003cSLES/OpenSLES_Android.h\\\u003e and\n\\\u003cSLES/OpenSLES_AndroidConfiguration.h\\\u003e.\n\nThis section begins by explaining\n[how to incorporate OpenSL ES into your app](/ndk/guides/audio/opensl/getting-started).\nNext, it explains what you need to know\nabout the Android implementation of OpenSL ES, focusing first on the\n[differences](/ndk/guides/audio/opensl/opensl-for-android) between this implementation and the\nreference specification and then\n[additional extensions](/ndk/guides/audio/opensl/android-extensions)\nfor Android compatibility. This section concludes with some supplemental\n[programming notes](/ndk/guides/audio/opensl/opensl-prog-notes) to ensure proper\nimplementation of OpenSL ES."]]