Class SilenceMediaSource

  • All Implemented Interfaces:

    public final class SilenceMediaSource
    extends BaseMediaSource
    Deprecated. is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
    Media source with a single period consisting of silent raw audio of a given duration.
    • Field Detail

      • MEDIA_ID

        public static final String MEDIA_ID
        The media id used by any media item of silence media sources.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SilenceMediaSource

        public SilenceMediaSource​(long durationUs)
        Creates a new media source providing silent audio of the given duration.
        durationUs - The duration of silent audio to output, in microseconds.