I'm creating an app that allows you to choose an audio file on the device, show a preview of graphical music track of the selected file and then send it to the firebase storage. My problem is to show the preview of the chosen file as I don't know if there is something that allows it. For example, for the images there is the imageview for the videos the videoview but for the audio files I don't know what to use. I add a photo of what I would like to do. Thanks in advance to those who will answer.
Asked
Active
Viewed 201 times
1 Answers
1
If what you want is a button what the user can click to play the audio, you can use a MediaPlayer
, as suggested here: how to play audio file in android
If what you want is to make a visual preview of the waveform from the audio file, you can reference this answer, which involves creating a custom view and analyzing the audio file and render the resulting waveform: Show waveform of audio

Maurice Lam
- 1,577
- 9
- 14
-
I would like to show the preview of the selected audio file (for example an album image or a default image) as for images or videos. I don't know if it's clearer now – Francesco Bottiglia Jan 23 '21 at 18:55