Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Các ứng dụng âm thanh hiệu suất cao thường đòi hỏi nhiều chức năng chứ không chỉ dừng lại ở chức năng phát hoặc ghi âm đơn giản. Các ứng dụng như vậy cần có hành vi hệ thống thích ứng theo thời gian thực. Sau đây là một số trường hợp sử dụng thường gặp:
Máy trạm âm thanh kỹ thuật số
Bộ tổng hợp
Trống máy
Ứng dụng học nhạc
Ứng dụng karaoke
Bộ hoà âm DJ
Hiệu ứng âm thanh
Hội nghị truyền hình/truyền thanh
Mục này giải thích các nguyên tắc chung để giảm thiểu độ trễ âm thanh.
Mục này cũng đưa ra lời khuyên về việc lấy mẫu âm thanh, để giúp bạn chọn tốc độ lấy mẫu tối ưu và xem xét ưu điểm cũng như nhược điểm của việc sử dụng kiểu dữ liệu dấu phẩy động để biểu diễn dữ liệu âm thanh.
Phần còn lại của mục này mô tả hai thư viện hiện có để viết ứng dụng âm thanh hiệu suất cao:
OpenSL ES là phương thức triển khai dành riêng cho Android của bản đặc tả OpenSL ES™ API do Tập đoàn Khronos phát triển.
Không nên dùng OpenSL ES cho các thiết kế mới. Nhà phát triển ứng dụng và nhà cung cấp phần mềm trung gian nên nhắm đến giao diện âm thanh gốc Oboe hoặc AAudio.
AAudio được phát triển dưới dạng một giải pháp gốc Android gọn nhẹ thay thế cho thư viện OpenSL ES. API AAudio nhỏ gọn hơn và dễ sử dụng hơn OpenSL ES.
Tài nguyên khác
Để tìm hiểu thêm, hãy tận dụng các tài nguyên sau đây:
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[],[],null,["# High-performance audio\n\nHigh performance audio apps typically require more functionality than the simple\nability to play or record sound. They demand responsive realtime system\nbehavior. Some typical use cases include:\n\n- Digital audio workstations\n- Synthesizers\n- Drum machines\n- Music learning apps\n- Karaoke apps\n- DJ mixing\n- Audio effects\n- Video/audio conferencing\n\nThis section explains the general principles of minimizing\n[audio latency](/ndk/guides/audio/audio-latency).\nIt also provides [advice about audio sampling](/ndk/guides/audio/sampling-audio),\nto help you choose the optimal sample rate and consider the pros and cons of using floating-point\nnumbers to represent your audio data.\n\nThe rest of the section describes the two libraries that\nare available for writing high-performance audio applications:\n\n- [OpenSL ES](/ndk/guides/audio/opensl) is an Android-specific implementation of the OpenSL ES™ API specification from the Khronos Group. OpenSL ES is not recommended for new designs. App developers and middleware providers should target either Oboe or AAudio as the native audio interface.\n- [AAudio](/ndk/guides/audio/aaudio/aaudio) was developed as a lightweight, native Android alternative to the OpenSL ES library. The AAudio API is smaller and easier to use than OpenSL ES.\n\n| **Note:** Developers should consider using the open source Oboe library which is available on [GitHub](https://github.com/google/oboe). Oboe is a C++ wrapper that provides an API that closely resembles AAudio. It calls AAudio when it is available, and falls back to OpenSL ES if AAudio is not available.\n\nAdditional resources\n--------------------\n\nTo learn more, take advantage of the following resources:\n\n\u003cbr /\u003e\n\n### Sample\n\n- [Oboe Samples](https://github.com/google/oboe/tree/master/samples)\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n### Codelabs\n\n- [Making Waves Part 1 - Build a Synthesizer](/codelabs/making-waves-1-synth)\n- [Making More Waves - Sampler](/codelabs/making-waves-2-sampler)\n- [Build a Musical Game using Oboe](https://developer.android.com/codelabs/musicalgame-using-oboe)\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n### Videos\n\n- [Getting Started with Oboe](http://bit.ly/Introducing-Oboe)\n- [Best Practices for Android Audio (Google I/O '17)](https://www.youtube.com/watch?v=C0BPXZIvG-Q)\n\n\u003cbr /\u003e"]]