Android - How to get list of AudioManager / AudioSystem parameters

前端 未结 1 1955
梦如初夏
梦如初夏 2021-02-05 11:40

AudioManager has a setParameters method that accepts a Key-Value pair in string representation (\"parameter_name=parameter_value\").
Internally, it calls native

相关标签:
1条回答
  • 2021-02-05 12:26

    After brief investigation I can guess that there is no reliable way to enumerate all available keys for audio device parameters. Android headers define small set of general parameters, that probably should be supported by all devices. You can find actual keys here (look for AUDIO_PARAMETER_* macros). And interface to actual device implementation struct audio_hw_device (that is implemented by vendor) has only get_parameters()/set_parameters() and no enumeration entry points. So, there is no way to request full list of supported parameter keys.

    To top it off:

    1. we have small set of predefined, common parameters
    2. to cope with vendor-specific parameters - we should obtain list of extra keys from vendor docs or hardware related sources for particular device.

    Any correctives are welcome.

    0 讨论(0)
提交回复
热议问题