I want to check if my video contains a sound or not. Based on that I want to add sound enable/disable functionality in my project.
Asked
Active
Viewed 774 times
1
-
check this answer [link](https://stackoverflow.com/a/27404447/7022347). It might help you. – Sohel Mahmud Jan 08 '20 at 10:37
1 Answers
2
You can track the current tracks with Player#EventListener#OnTracksChanged and get the current ones with Player#getCurrentTrackGroups(). If you go through the track groups you can look for the type. If you additionally want to check if any of the audio tracks was selected, then Player#getCurrentTrackSelections() is the place to look at.

L.Petrosyan
- 430
- 4
- 12
-
Player#getCurrentTrackGroups() return info about all formats which contains track has audio, video and text etc. – Munir Jan 15 '20 at 08:13