Reputation: 5598
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
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