bogerchan / Nier-Visualizer

A lightweight and efficient Android visual library.
Apache License 2.0
576 stars 75 forks source link

Visualizer not working properly for AudioFormat.ENCODING_PCM_16BIT configuration #30

Closed ghost closed 4 years ago

ghost commented 4 years ago

Hi Sir,

I think Visualizer not working properly for AudioFormat.ENCODING_PCM_16BIT configuration. Can you support it?

Thanks,

bogerchan commented 4 years ago

Hi, @huyletran84 , Thanks for using the library, can you show more details about it?

tpeet commented 4 years ago

I'm stumbling upon the same problem. When using AudioFormat.ENCODING_PCM_16BIT the data is saved into ShortArrays with 16-bit signed values, instead of unsigned 8-bit ByteArrays.

fetchWaveData() can only return ByteArrays, and currently that would require some manual conversion.

ghost commented 4 years ago

Hi @bogerchan,

The problem that @tpeet said is the same with my problem now. About UI, when changing the config to AudioFormat.ENCODING_PCM_16BIT, the visual chart is drawn not well. I can not describe about it because my English is not good. But can you please change the config and run demo application. I think you can understand what i said.

Thanks,

bogerchan commented 4 years ago

Thanks for your feedback, I will try to fix the issue.

bogerchan commented 4 years ago

Hi, I have updated the code to support AudioFormat.ENCODING_PCM_16BIT, hope to help you. The PR is #32