MP3 Decoding on Android

前端 未结 4 857
鱼传尺愫
鱼传尺愫 2021-02-01 16:15

We\'re implementing a program for Android phones that plays audio streamed from the internet. Here\'s approximately what we do:

  1. Download a custom encrypted format
4条回答
  •  南方客
    南方客 (楼主)
    2021-02-01 16:44

    I haven't tried this, but I believe you can give the media player a file descriptor:

    public void setDataSource (FileDescriptor fd, long offset, long length)
    

    Maybe you could write the decrypted mp3 out to a file and play it using the file descriptor. This might even work for streaming assuming you know the file length ahead of time. If it works, it would be a lot simpler than doing a localhost webserver.

提交回复
热议问题