0

Does anyone know how to do sound/media Localization in android like we do with strings translations to support different languages in the app? because i didn't find any good resources for this feature.

EDIT - This is how i using the media resources files, by the way the strings localization work properly, but the sound not.

I am using SoundPool to play the sound i just pass the resources ID for example R.raw.ecg_recording.

enter image description here

Eli
  • 31
  • 4
  • You can use the strings localisation to store paths of the sound/media if they are shipped with the app (example: raw/assets) & play relevant media from path depending on the language. – Darshan Jul 17 '22 at 09:12
  • It depends on how you're using the media files in the first place. For example, if you use resources, the usual variation mechanism works for all resource types. – laalto Jul 17 '22 at 09:36
  • 1
    After the edit: are you using a wrapped Context to support languages other than the system default? If so, you need to use a similarly wrapped context with SoundPool too. – laalto Jul 17 '22 at 10:51
  • Thank you so much for the help and quick response, it works!! – Eli Jul 17 '22 at 11:09

0 Answers0