Android Question [SOLVED]How can I set the source of SimpleExoPlayer to an ExternalStorage .wav file?

William Lancee

Well-Known Member
Licensed User
Longtime User
The code below works, but requires an extra copying step that delays the start of play.

B4X:
            Dim in As InputStream = Storage.OpenInputStream(f)
            Dim out As OutputStream = File.OpenOutput(File.DirInternal, "temp", False)
            File.Copy2(in, out)
            out.Close

            player1.Pause
            sources.Clear
            sources.Add(player1.CreateFileSource(File.DirInternal, "temp"))
            player1.Prepare(player1.CreateListSource(sources))
            Sleep(100)
            player1.Volume = .8
            ListView1.Visible = False
            SimpleExoPlayerView1.Visible = True
            SimpleExoPlayerView1.ControllerTimeout = -1
            SimpleExoPlayerView1.Player = player1
            player1.Play
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…