Skip to content

how to remove fade in and fade out of audio in begining and when we pause the player? #51

Answered by jrfeng
sampatsharma143 asked this question in Q&A
Discussion options

You must be logged in to vote

add a new method setVolumeEaseEnabled(boolean). override PlayerService#onCreateMusicPlayer and invoke mediaMusicPlayer.setVolumeEaseEnabled(false).

Example:

@NonNull
@Override
protected MusicPlayer onCreateMusicPlayer(@NonNull Context context, @NonNull MusicItem musicItem, @NonNull Uri uri) {
    MediaMusicPlayer mediaMusicPlayer = new MediaMusicPlayer(context,uri);
    
    mediaMusicPlayer.setVolumeEaseEnabled(false);   // disable volume ease effect
    
    return mediaMusicPlayer;
}

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by jrfeng
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants