alibaba / alibaba/CicadaPlayer
Android设备播放多音轨ts文件,无音频输出。对比Android中MediaPlayer通用API,缺失一些重要接口
- Dominant language
- C++
- Stars
- 771
- Forks
- 209
- PR merge metrics
- No merged PRs in 30d
Description
单音轨文件播放正常,有音频输出。
多音轨文件播放无音频输出,并且手动设置音轨未生效。测试代码如下:

今天试着加到公司项目中,发现还需要处理很多通用功能,暂时放弃~
对比原生MediaPlayer、ExoPlayer、IjkPlayer提供的API,CicadaPlayer主要缺少:
- isPlaying() 是否正在播放,虽然可以通过其它手段判断,有会更方便
- getCurrentPosition() 当前播放位置,虽然监听OnInfoListener可以得到,有会更方便
- setVolume(float leftVolume, float rightVolume) 设置左声道、右声道音量,对于单音轨多声道的使用场景
- getAudioSessionId() 播放器ID(The audio session ID is a system wide unique identifier for the audio stream played by this MediaPlayer instance.)做频谱、均衡器、重低音等需要参数
- CicadaPlayer已经有了设置速率setSpeed()方法,而设置音调setPitch()还没
目前对CicadaPlayer使用还不够深入,说法上有错误的地方还望指出~~~
测试文件有点大,需要的话可以发邮箱
上午手点快了,所有多提了一次 ^_^
Contributor guide
Research direction
Start with the supplied Android test code and reproduce playback of the multi-track TS sample, then compare the behavior and available APIs with Android MediaPlayer, ExoPlayer, and IjkPlayer. The issue names no repository files or tests; done would require an agreed scope covering the missing audio output behavior and the requested player APIs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, cpp
- Domain
- audio-video-rtc, mobile-dev
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100