Khi bạn đã hoàn thành phát lại âm thanh của bạn, bạn có thể chọn để từ bỏ tập trung âm thanh, như thể hiện trong Liệt kê 15-13.
Thông thường, điều này chỉ cần thiết khi ứng dụng của bạn mất tập trung âm thanh chỉ thoáng qua. Trong trường hợp của một máy nghe nhạc phương tiện truyền thông, nó là hợp lý để duy trì sự tập trung âm thanh khi âm nhạc được chơi hoặc hoạt động của bạn là ở phía trước.
Tạm dừng Playback Khi thay đổi Output
Nếu dòng đầu ra hiện nay là một tai nghe kèm theo, ngắt kết nối nó sẽ cho kết quả hệ thống tự động chuyển đổi đầu ra loa của thiết bị. Nó được coi là thực hành tốt để tạm dừng (hoặc giảm khối lượng) sản lượng âm thanh của bạn trong những trường hợp này.
Để làm như vậy, tạo ra một nhận Broadcast mà nghe cho AudioManager. action_audio_becoming_ phát sóng ồn ào và tạm dừng phát lại của bạn, như thể hiện trong Liệt kê 15-14.
đang được dịch, vui lòng đợi..