0

I am getting the following errors when I run my app on Android 9.0. It is not playing the mp3 audio on 9.0 but working good on lower versions.

W/AudioTrack( 5492): Use of stream types is deprecated for operations other than volume control W/AudioTrack( 5492): See the documentation of AudioTrack() for what to use instead with android.media.AudioAttributes to qualify your playback use case W/MediaPlayer( 5492): Couldn't open http://myDomain/Intro_1543483066.mp3: java.io.FileNotFoundException: No content provider: http://myDomain/Intro_1543483066.mp3

1 Answers1

1

It's maybe when you request AudioFocus : can you share us the code you use ?

Here is a working sample on how to do it on Android > O :

var audioAttributes = new AudioAttributes.Builder()
                             .SetLegacyStreamType(Stream.Music).Build();

new AudioFocusRequestClass.Builder(AudioFocus.Gain)
      .SetAudioAttributes(audioAttributes)
      .SetOnAudioFocusChangeListener(this)
      .Build();
Jonathan ANTOINE
  • 9,021
  • 1
  • 23
  • 33