Search code examples
androidimagesynchronizationmp3

Android: synchronization of Audio, images and text in a Media Player,


I would like to know how I can synchronize an mp3 file, a text box and images (mp3, text and images must be received via http) that is will be displayed on a video player which must receive and show the images every 10 seconds, and likewise have a text box with the synchronized audio and therefore with the images (showing the text of the mp3), I have researched, but i not know where to start, how to manage the intervals and the data, with methods as "timer" in c #, really would appreciate your help.


Solution

  • I am assuming the text and the images have TimeStamps associated with them. (TimeStamps - Time at which they should be displayed relative to the audio), if so then you can do this

    • Play the audio file using the MediaPlayer class
    • Use the method getCurrentPosition() to get the time value
    • Based on the time above check if you need to update the image or the text or both, if you need to then update TextView and ImageView