There seems to be a mistake in the Hexagin SDK document that needs to be corrected.
In the documengt page detailing the steps to carry out audio calibration for predefined / custom modules, there is an example provided to set modue paramters --> file:///C:/Qualcomm/Hexagon_SDK/3.5.2/docs/Audio/audio_calibration_using_app.html#Set%20data%20of%20one%20parameter.
int[] param_data = [0x4000, 0x8000]; // volume1 and volume 2 String value = b64encode(param_data); String key= "cal_persist=0;cal_devid=2;cal_apptype=69936;cal_caltype=0;cal_samplerate=48000;cal_topoid=0x10000001;cal_moduleid=0x10001111;cal_paramid=0x10001112;"; key = key + "cal_data="; key = key + param_data; AudioManager aManager=(AudioManager)getSystemService(Context.AUDIO_SERVICE); aManager.setParameters(key);
The example intends to take the param data set, encode it in base64, and add it to the set of kv pairs to be set by the acdb-loader helper functions triggered via audiomanager API. The "cal_data" value should be set as the encoded data string. However, the example incorrectly sets it to the integer value itself (param_data)
The correct code should be something like this (tried and tested):
int[] param_data = [0x4000, 0x8000]; // volume1 and volume 2 String value = b64encode(param_data); String key= "cal_persist=0;cal_devid=2;cal_apptype=69936;cal_caltype=0;cal_samplerate=48000;cal_topoid=0x10000001;cal_moduleid=0x10001111;cal_paramid=0x10001112;"; key = key + "cal_data="; key = key + value; AudioManager aManager=(AudioManager)getSystemService(Context.AUDIO_SERVICE); aManager.setParameters(key);
- Abhijit Hota
Hello Abhijit,
Thank you for bringing this to our attention. We will make the change in the upcoming release.
Thanks,
Hsin-I