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

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -