TAILIEUCHUNG - Controlling Panning

Kiểm soát Panning Mặc dù khối lượng của âm thanh một cho một cảm giác về khoảng cách, panning giúp xác định trái / phải vị trí. Tương tự như thiết lập âm lượng của một đối tượng âm thanh, thiết lập một đối tượng âm thanh của panning là đơn giản, như ví dụ dưới đây trình bày | Controlling Panning Although the volume of a sound gives a sense of distance panning helps determine its left right position. Similar to setting the volume of a Sound object setting a Sound object s panning is straightforward as the following example demonstrates 100 This code causes the bounce sound to play out of the right speaker only. You can set a Sound object s panning anywhere between -100 left speaker only and 100 right speaker only with a setting of 0 causing the sound to play equally out of both speakers. As with the setVolume method the setPan method can use the value of a variable to set a Sound object s panning more dynamically as the following example demonstrates myVariable We ll use a variable to set the pan of the bounce Sound object. As in the preceding exercise this variable will contain a percentage value between -100 and 100 encompassing the entire spectrum of panning values . We ll base the pan setting of the bounce Sound object on the horizontal distance of the mouse pointer from the center point in either the left or right quadrant. To make this technique work we must do the following 1. Determine the horizontal size of the draggable boundary and then split it in two essentially breaking the boundary into two quadrants left and right. 2. Establish the position of the horizontal center. 3. Determine the mouse pointer s current horizontal position at the exact center or in the left or right quadrant each time it s moved. If the mouse pointer is at the exact center point the pan is set to 0. If the mouse is left of the center point in the left quadrant the pan is set to a value between -100 and 0. This value represents the horizontal distance percentage-based of the mouse pointer from the center point in relation to the overall size of the quadrant. Likewise if the mouse pointer is right of the center point in the right quadrant the pan is set to a value between 0 and 100 which represents the horizontal distance .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.