[Android] DJ MIXING 만들기
ANDROID/CONCEPT 2018. 3. 25. 23:51 |1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | package com.example.kbw.djmixing; import android.media.AudioManager; import android.media.SoundPool; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; public class MainActivity extends AppCompatActivity { SoundPool sound; int soundId1; int soundId2; int soundId3; int soundId4; int soundId5; int soundId6; int soundId7; int soundId8; int soundId9; int soundId10; int soundId11; int soundId12; int soundId13; int soundId14; int soundId15; int soundId16; int soundId17; int soundId18; int soundId19; int soundId20; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); sound = new SoundPool(5, AudioManager.STREAM_MUSIC, 0); soundId1 = sound.load(this, R.raw.beat1, 1); soundId2 = sound.load(this, R.raw.beat2, 1); soundId3 = sound.load(this, R.raw.beat3, 1); soundId4 = sound.load(this, R.raw.beat4, 1); soundId5 = sound.load(this, R.raw.beat5, 1); soundId6 = sound.load(this, R.raw.beat6, 1); soundId7 = sound.load(this, R.raw.beat7, 1); soundId8 = sound.load(this, R.raw.beat8, 1); soundId9 = sound.load(this, R.raw.beat9, 1); soundId10 = sound.load(this, R.raw.beat10, 1); soundId11 = sound.load(this, R.raw.beat11, 1); soundId12 = sound.load(this, R.raw.beat12, 1); soundId13 = sound.load(this, R.raw.beat13, 1); soundId14 = sound.load(this, R.raw.beat14, 1); soundId15 = sound.load(this, R.raw.beat15, 1); soundId16 = sound.load(this, R.raw.beat16, 1); soundId17 = sound.load(this, R.raw.beat17, 1); soundId18 = sound.load(this, R.raw.beat18, 1); soundId19 = sound.load(this, R.raw.beat19, 1); soundId20 = sound.load(this, R.raw.beat20, 1); } public void func01(View view) { sound.play(soundId1, 1f, 1f,1, 0,1f); } public void func02(View view) { sound.play(soundId2, 1f, 1f,1, 0,1f); } public void func03(View view) { sound.play(soundId3, 1f, 1f,1, 0,1f); } public void func04(View view) { sound.play(soundId4, 1f, 1f,1, 0,1f); } public void func05(View view) { sound.play(soundId5, 1f, 1f,1, 0,1f); } public void func06(View view) { sound.play(soundId6, 1f, 1f,1, 0,1f); } public void func07(View view) { sound.play(soundId7, 1f, 1f,1, 0,1f); } public void func08(View view) { sound.play(soundId8, 1f, 1f,1, 0,1f); } public void func09(View view) { sound.play(soundId9, 1f, 1f,1, 0,1f); } public void func10(View view) { sound.play(soundId10, 1f, 1f,1, 0,1f); } public void func11(View view) { sound.play(soundId11, 1f, 1f,1, 0,1f); } public void func12(View view) { sound.play(soundId12, 1f, 1f,1, 0,1f); } public void func13(View view) { sound.play(soundId13, 1f, 1f,1, 0,1f); } public void func14(View view) { sound.play(soundId14, 1f, 1f,1, 0,1f); } public void func15(View view) { sound.play(soundId15, 1f, 1f,1, 0,1f); } public void func16(View view) { sound.play(soundId16, 1f, 1f,1, 0,1f); } public void func17(View view) { sound.play(soundId17, 1f, 1f,1, 0,1f); } public void func18(View view) { sound.play(soundId18, 1f, 1f,1, 0,1f); } public void func19(View view) { sound.play(soundId19, 1f, 1f,1, 0,1f); } public void func20(View view) { sound.play(soundId20, 1f, 1f,1, 0,1f); } } | cs |
'ANDROID > CONCEPT' 카테고리의 다른 글
[Android] 08강. 버튼 이미지 애니메이션(Image Button) (0) | 2018.03.27 |
---|---|
[Android][동빈나] 07강. 유튜브 API 연동 (0) | 2018.03.27 |
[Android] 06강. 액티비티 화면 전환 (Activity Change) (0) | 2018.03.26 |
[Android] 4강 - 네비게이션 메뉴 바 만들기 (To Make Menu) (0) | 2018.03.26 |
[Android] 3강. 알림창을 이용한 종료 버튼 및 리스트 보기 (0) | 2018.03.25 |