Android volume control curve and calling Process

Source: Internet
Author: User

The Android audio curve call is set down from the ui. There are different UIS Based on stream audio, which are divided into 7 and 15 steps, corresponding to the actual step 100. For the conversion process, see the volIndexToAmpl function in AudioPolicyManagerBase. cpp. 4.1 The Calling process is different from the previous one, and the principle is the same. I think the previous version is linear, and the new version is a three-segment line. Why is it a straight line? The Voice perception is not linear, but a logarithm. This can correspond to the android principle with a base-10 logarithm. The following is the derivation of the decibel formula. In the audio, the db uses addition and subtraction to adjust the volume. Currently, three broken lines are used. I think it is more convenient to adjust the variation of sound in different regions. The lowest and highest voices should be adjusted from the lower-layer driver. The volIndexToAmpl function implements the preceding Conversion Relationship. This function starts the following call process by responding to the volume key benefits to adjust the volume. The following is the call process of Audiomanager after the volume key is pressed. java handleKeyDown adjustSuggestStreamVolume service. adjustSuggestStreamVolume AudioService. java adjustSuggestStreamVolume adjustStreamVolum sendMSG (mAudioHandler, MSG_SET_DEVICE_VOLUME, SND_QUEUE, device, 0, streamstate, 0); message mechanism AudioService. java AudioHandler handleMessage setDeviceVolume StreamState. applyDeviceVolume audioSystem. setStreamVolumeIndex JNI mechanism Android_media_AudioSystem.cpp AudioPolicyManagerBase. cpp setStreamVolumeIndex checkAndSetVolume computeVolume volIndexToAmpl

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.