@Override public void onClick(View v) { // TODO Auto-generated method stub switch(v.getId()) { case R.id.low : pitch = 0.5f;playit();break;
case R.id.normal: pitch = 1.0f;playit();break;
case R.id.high: pitch = 2.0f;playit();break; }
}
private void playit() { // TODO Auto-generated method stub sp = new SoundPool(1,AudioManager.STREAM_MUSIC,0); final int i = sp.load(this, R.raw.music, 0); sp.setOnLoadCompleteListener(new OnLoadCompleteListener() {
@Override public void onLoadComplete(SoundPool arg0, int arg1, int arg2) { // TODO Auto-generated method stub sp.play(i, 1,1,0,0,pitch); }
All About Reading: Level 2 - A Homeschooling Parent's Review Background I am a certified Elementary and Early Childhood teacher and a certified Speech-Language Pathologist. I am homeschooling my kindergartener and preschooler. My son was always precocious where reading is concerned. He's reading independently at this point and I credit our experiences with All About Reading for much of that. Even as a toddler, he was always interested in his letters. When we read Chicka Chicka Boom Boom to him as a toddler he was very interested in identifying all the letters at the beginning and end of the book. We fed that interest. He just loved to tune into letters and their sounds. So, a little over a year ago, when I began to think about homeschooling I decided to dip my toe into the water, so to speak, with a reading program. Michael loved letters. I loved reading. It seemed like a great place to start. After researching many programs and trying the free sample materia...
Hey Guys, Today we are going to see the usage of SoundPool in Android. So lets get started. Download 1) First of all create an Android Application Project. 2) Next go to "res/layout/activity_main.xml" and create a button there. activity_main.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".MainActivity" > <Button android:layout_width="wrap_content" ...
Comments
Post a Comment