Isaac Sekamatte
Isaac Sekamatte

Reputation: 5598

'AudioAttributes()' not public in 'android.media.AudioAttributes'. Cannot be accessed from outside package

I'm getting an error mentioned below when I try to instantiate AudioAttributes for setting AudioAttributes inside the sound pool.

'AudioAttributes()' not public in 'android.media.AudioAttributes'. Cannot be accessed from outside package

AudioAttributes attributes = new AudioAttributes  ().Builder().build();

I need help setting AudioAttributes in SoundPool

Upvotes: 0

Views: 1105

Answers (1)

Nayan Srivastava
Nayan Srivastava

Reputation: 3725

The constructor for AudioAttributes is not public, you need to use Builder class which is a subclass nested inside AudioAttributes. Change your assignment to below

AudioAttributes audioAttributes= new AudioAttributes.Builder().build();

Upvotes: 4

Related Questions