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

Some audio files (MP3) can not be played correctly #5772

Closed
Furystorm opened this issue Apr 17, 2019 · 2 comments
Closed

Some audio files (MP3) can not be played correctly #5772

Furystorm opened this issue Apr 17, 2019 · 2 comments
Assignees

Comments

@Furystorm
Copy link

Furystorm commented Apr 17, 2019

[REQUIRED] Content description

I am using ExoPlayer demo app to play audio, some "bad" mp3 file can not be played correctly. Some can not play any sound, some can play but will interrupt with error during playing, and/or the duration time is not correct. These files are badly truncated, I guess, or somehow malformed.

An EOFException was thrown, fitting with "having read at least one byte, but fewer than length" case in the doc.

com.google.android.exoplayer2.demo E/EventLogger: internalError [0.55, -0.02, window=0, period=0, loadError]
    java.io.EOFException
        at com.google.android.exoplayer2.extractor.DefaultExtractorInput.readFromDataSource(DefaultExtractorInput.java:265)
        at com.google.android.exoplayer2.extractor.DefaultExtractorInput.advancePeekPosition(DefaultExtractorInput.java:135)
        at com.google.android.exoplayer2.extractor.DefaultExtractorInput.peekFully(DefaultExtractorInput.java:116)
        at com.google.android.exoplayer2.extractor.mp3.Mp3Extractor.peekEndOfStreamOrHeader(Mp3Extractor.java:345)
        at com.google.android.exoplayer2.extractor.mp3.Mp3Extractor.readSample(Mp3Extractor.java:226)
        at com.google.android.exoplayer2.extractor.mp3.Mp3Extractor.read(Mp3Extractor.java:218)
        at com.google.android.exoplayer2.source.ExtractorMediaPeriod$ExtractingLoadable.load(ExtractorMediaPeriod.java:898)
        at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:381)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
        at java.lang.Thread.run(Thread.java:784)

In my app, I tried to change the playback speed, and it does change. e.g. for the examples audio below, the first audio can play with 0.6 speed, and the second audio can not play with 1.4 speed.

But other players can play these files well, so how could I play these files with exoplayer, or is there any workaround?

[REQUIRED] Link to test content

[
  {
    "name": "bad mp3 files",
    "samples": [
      {
        "name": "can_not_play",
        "uri": "https://res.5ideachinese.com/voice/2019/04/2854674ddcfd73019d8bbdf556f3ed2a.mp3"
      },
      {
        "name": "play_with_error_and_duration_not_correct",
        "uri": "https://res.5ideachinese.com/voice/2019/04/7e40e4622b7c067626ce4c721c29f4d0.mp3"
      }
    ]
  }
]

[REQUIRED] Version of ExoPlayer being used

r2.9.6

[REQUIRED] Device(s) and version(s) of Android being used

We met this issue in different kinds of versions and devices, perhaps, it has nothing do with the versions or devices.

@ojw28
Copy link
Contributor

ojw28 commented Apr 17, 2019

The media is indeed badly clipped. We can likely fix playback to work. We will not fix the "bad duration" problem for the second stream (the extra 2 seconds will play out as silence).

andrewlewis pushed a commit that referenced this issue Apr 18, 2019
Issue: #5772
PiperOrigin-RevId: 243987497
@ojw28 ojw28 closed this as completed Apr 18, 2019
ojw28 added a commit that referenced this issue Apr 18, 2019
Issue: #5772
PiperOrigin-RevId: 243987497
@Furystorm
Copy link
Author

Thanks! It helps me a lot.

@google google locked and limited conversation to collaborators Aug 29, 2019
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

2 participants