audio - Android soundpool not working -
when try run soundpool in program, keeps giving me error.
firstly, added
soundpool sp; int shot = 0; at beginning of program. tried add sound in method wanted run adding following code,
sp = new soundpool(5, audiomanager.stream_music, 0); shot = sp.load(this, r.raw.sound, 1); however, keeps underlining .load , kept saying "the method load(context, int, int) in type soundpool not applicable arguments (gameview, int, int)"
how can fix this?
you can't pass view first parameter, needs context. use this.getcontext() instead.
Comments
Post a Comment