简体   繁体   English

在Android的Exoplayer中播放WAV音频文件

[英]Play WAV audio files in Android's Exoplayer

I implemented my Exoplayer and I'm playing songs using this code: 我实现了Exoplayer,并使用以下代码播放歌曲:

    Allocator allocator = new DefaultAllocator(BUFFER_SEGMENT_SIZE);
    DataSource dataSource = new DefaultUriDataSource(mService, null, "useragent");
    ExtractorSampleSource sampleSource = new ExtractorSampleSource(Uri.parse(url), dataSource, allocator, BUFFER_SEGMENT_COUNT * BUFFER_SEGMENT_SIZE);
    MediaCodecAudioTrackRenderer audioRenderer = new MediaCodecAudioTrackRenderer(sampleSource, MediaCodecSelector.DEFAULT);
    mExoPlayer.prepare(audioRenderer);

I want to play not only MP3 audio files, but also WAV files. 我不仅要播放MP3音频文件,还希望播放WAV文件。 I read that I should create my custom Extractor but I really can not find any documentation for it. 我读到应该创建自定义提取器,但实际上找不到任何文档。

Does anybody know how can I play WAV audio files in my Exoplayer? 有人知道如何在Exoplayer中播放WAV音频文件吗?

Have a look at this : https://github.com/google/ExoPlayer/issues/1246 看看这个: https : //github.com/google/ExoPlayer/issues/1246

Might be implemented in future releases 可能在将来的版本中实现

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM