简体   繁体   中英

Play WAV audio files in Android's Exoplayer

I implemented my Exoplayer and I'm playing songs using this code:

    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. 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?

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

Might be implemented in future releases

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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