Giter Site home page Giter Site logo

Comments (4)

marcbaechinger avatar marcbaechinger commented on July 20, 2024

That error is coming from the framework AudioTrack saying it does not support the values that you try to set. See JavaDoc here.

I guess this does not happen if you do not set setEnableAudioTrackPlaybackParams to true. Can you confirm?

from media.

XilinJia avatar XilinJia commented on July 20, 2024

Before my setting, the log:
Log.d(TAG, "setPlaybackParams speed=$speed pitch=${playbackParameters.pitch}")
shows: pitch is always 1.0. I tried speed from 0.5 to 2.5, and it doesn't matter what number it is, always got the exception.
If you look at the stacktrace, when I set say speed=1.5, somewhere in the call stack to AudioTrack the number got messed up.

As mentioned in the report, I tested my code on other Android devices, the problem didn't happen. It only happens with my S21 Android 14 device.

And in my code, setEnableAudioTrackPlaybackParams was not called.

I tried to specifically calling setEnableAudioTrackPlaybackParams with:
exoPlayer = ExoPlayer.Builder(context, DefaultRenderersFactory(context).setEnableAudioTrackPlaybackParams(false)) .setTrackSelector(trackSelector) .setLoadControl(loadControl.build()) .build()
And the issue is the same.

from media.

marcbaechinger avatar marcbaechinger commented on July 20, 2024

Thanks! Can you shed some more light on the configuration under which you are seeing this warning?

  1. Is setEnableAudioTrackPlaybackParams set to true?
  2. Is the player playing in offload mode when you see this warning?
  3. Have you applied some specific customization to buffer sizes when you see this warning?

The easiest way for us to help is with the ExoPlayer demo app. You are saying above it is not reproducible there. Can you explain why or how we can repro in the demo app? The question is again pointing towards whether you have some specific setup of the player that isn't applied in the demo app, else the demo app could repro this as well.

from media.

XilinJia avatar XilinJia commented on July 20, 2024

Ok, it has to do with offload.

I built the player with:

       val audioOffloadPreferences = AudioOffloadPreferences.Builder()
            .setAudioOffloadMode(AudioOffloadPreferences.AUDIO_OFFLOAD_MODE_ENABLED)
            .setIsGaplessSupportRequired(true)
            .build()
        exoPlayer = ExoPlayer.Builder(context, DefaultRenderersFactory(context))
            .setTrackSelector(trackSelector)
            .setLoadControl(loadControl.build())
            .build()
        exoPlayer.setSeekParameters(SeekParameters.EXACT)
        exoPlayer.trackSelectionParameters = exoPlayer.trackSelectionParameters
            .buildUpon()
            .setAudioOffloadPreferences(audioOffloadPreferences)
            .build()

So that has the problem.

Now I changed it to:

        val audioOffloadPreferences = AudioOffloadPreferences.Builder()
            .setAudioOffloadMode(AudioOffloadPreferences.AUDIO_OFFLOAD_MODE_ENABLED) // Add additional options as needed
            .setIsGaplessSupportRequired(true)
            .setIsSpeedChangeSupportRequired(true)
            .build()
        exoPlayer = ExoPlayer.Builder(context, DefaultRenderersFactory(context))
            .setTrackSelector(trackSelector)
            .setLoadControl(loadControl.build())
            .build()
        exoPlayer.setSeekParameters(SeekParameters.EXACT)
        exoPlayer.trackSelectionParameters = exoPlayer.trackSelectionParameters
            .buildUpon()
            .setAudioOffloadPreferences(audioOffloadPreferences)
            .build()

by adding setIsSpeedChangeSupportRequired, then the exception doesn't occur, and play speed is set correctly on the S21.

Anyhow, if anyone wants to check about the program, my project Podcini is open source at https://github.com/XilinJia/Podcini.

from media.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.