diff --git a/OsmAnd/src/net/osmand/plus/voice/MediaCommandPlayerImpl.java b/OsmAnd/src/net/osmand/plus/voice/MediaCommandPlayerImpl.java index 7546b194a7..44f13e43fd 100644 --- a/OsmAnd/src/net/osmand/plus/voice/MediaCommandPlayerImpl.java +++ b/OsmAnd/src/net/osmand/plus/voice/MediaCommandPlayerImpl.java @@ -178,7 +178,10 @@ public class MediaCommandPlayerImpl extends AbstractPrologCommandPlayer implemen .setContentType(AudioAttributes.CONTENT_TYPE_SPEECH) .build()); } - mediaPlayer.setAudioStreamType(streamType); + if (Build.VERSION.SDK_INT < 26) { + // Deprecated in API Level 26, use above AudioAtrributes instead + mediaPlayer.setAudioStreamType(streamType); + } mediaPlayer.setDataSource(file.getAbsolutePath()); mediaPlayer.prepare(); mediaPlayer.setOnCompletionListener(this);