Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for 32bit audio WAV files #3379

Closed
Fireblend opened this issue Oct 19, 2017 · 2 comments
Closed

Support for 32bit audio WAV files #3379

Fireblend opened this issue Oct 19, 2017 · 2 comments
Assignees

Comments

@Fireblend
Copy link

Fireblend commented Oct 19, 2017

Issue description

I'm having trouble getting 32bit WAV audio files (sample provided below) to play using a regular ExtractorMediaSource. I always get an UnrecognizedInputFormatException with the "None of the available extractors (MatroskaExtractor, FragmentedMp4Extractor, Mp4Extractor, Mp3Extractor, AdtsExtractor, Ac3Extractor, TsExtractor, FlvExtractor, OggExtractor, PsExtractor, WavExtractor) could read the stream." message.

I can play these audio files with a regular AudioTrack by specifying the AudioFormat as PCM_FLOAT per Android's developer reference, which suggests there is native support for the file on Android, however, I've had no such luck with ExoPlayer.

Additionally, I found ticket #1246 which confirms there is support for 16bit and 24bit WAV audio files, however I can't find anything about 32bit audio support and would like clarification on whether ExoPlayer supports it or not.

Reproduction steps

Just attempt to play the file using a regular ExtractorMediaSource. I have a project which showcases this issue at this location:
https:/Fireblend/exoTest

It contains an audiotrackApp module which showcases the file playing as expected with Audiotrack, and an exoApp module in which the failure to play the file with a regular ExtractorMediaSource is demonstrated.

Link to test content

https:/Fireblend/exoTest/raw/master/Exotest/exoApp/src/main/res/raw/th_oial_32_float_48khz.wav

Version of ExoPlayer being used

r2.1.1

Device(s) and version(s) of Android being used

Motorola X Play, Android 6.0
Nexus 5, Android 6.0

A full bug report captured from the device

I suspect this isn't needed, but I'm attaching one anyway.
bugreport.txt

Thanks in advance!

@andrewlewis
Copy link
Collaborator

To support extracting this file, we need to update WavExtractor to handle format 3 (float), outputting a track with PCM float encoding.

For playback of the float track, I'm currently adding support for 32-bit float output (similar to #2517), which can be used by setting a flag when using FfmpegAudioRenderer. We could add an equivalent flag to MediaCodecAudioRenderer to output PCM float directly.

Alternatively, we could update ResamplingAudioProcessor to convert 32-bit float to 16-bit integer PCM, which would be lossy but has the advantage that audio processors could still be applied to the input.

@stefanomemrise
Copy link

is there any progress on this? any ETA? thanks

ojw28 pushed a commit that referenced this issue Jan 3, 2018
Issue: #3379

-------------
Created by MOE: https:/google/moe
MOE_MIGRATED_REVID=179925320
ojw28 pushed a commit that referenced this issue Jan 3, 2018
Issue: #3379

-------------
Created by MOE: https:/google/moe
MOE_MIGRATED_REVID=179925320
@google google locked and limited conversation to collaborators May 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants