마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

AudioFlinger could not create track, status -12 이 오류..

0 추천
 
 
public class Leveltwo extends Activity implements OnClickListener {
ImageView t1,t2,t3,t4,o1;
int count = 5;
    int o = 2;
    int touch = 0;
    int timer = 0;
    TextView time;
    TextView text;
    Handler mHandler;
     SoundPool sp;
int soundID;
 
    @Override
public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   requestWindowFeature(Window.FEATURE_NO_TITLE);
   setContentView(R.layout.leveltwo);
   // TODO Auto-generated method stub
        t1  = (ImageView)findViewById(R.id.t1);
        t2  = (ImageView)findViewById(R.id.t2);
        t3  = (ImageView)findViewById(R.id.t3);
        t4  = (ImageView)findViewById(R.id.t4);
        o1  = (ImageView)findViewById(R.id.o1);
        time = (TextView)findViewById(R.id.time);
        text = (TextView)findViewById(R.id.text);
    time.setTypeface(Typeface.createFromAsset(getAssets(), "FootballGothic.ttf"));
    text.setTypeface(Typeface.createFromAsset(getAssets(), "FootballGothic.ttf"));
        t1.setOnClickListener(this);
        t2.setOnClickListener(this);
        t3.setOnClickListener(this);
        t4.setOnClickListener(this);
        o1.setOnClickListener(this);
        
        sp = new SoundPool(5, AudioManager.STREAM_MUSIC, 0);
   soundID =sp.load(Leveltwo.this, R.raw.touch1,1);
   
   
        
        Intent intent = getIntent();
    timer = intent.getExtras().getInt("time",1);
        mHandler = new Handler() {
    public void handleMessage(Message msg) {
    time.setText(String.valueOf(timer));
    timer++;
    //1초간의 지연 시간을 두어 1초후에 자기자신이 호출 되도록 한다.
    mHandler.sendEmptyMessageDelayed(0,1000);
    }
   };
   mHandler.sendEmptyMessage(0);
        
}
 
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
sp.play(soundID, 1, 1, 0, 0, 1);
switch (v.getId()) {
case R.id.t1:
// sp.play(soundID, 1, 1, 0, 0, 1);
t1.setPressed(true);
t1.setVisibility(View.INVISIBLE);
count--;
break;
        case R.id.t2:
        // sp.play(soundID, 1, 1, 0, 0, 1);
        t2.setPressed(true);
        t2.setVisibility(View.INVISIBLE);
        count--;
break;
        case R.id.t3:
        // sp.play(soundID, 1, 1, 0, 0, 1);
        t3.setPressed(true);
        t3.setVisibility(View.INVISIBLE);
        count--;
       break;
        case R.id.t4:
        //sp.play(soundID, 1, 1, 0, 0, 1);
        t4.setPressed(true);
        t4.setVisibility(View.INVISIBLE);
        count--;
        break;
        case R.id.o1:
        // sp.play(soundID, 1, 1, 0, 0, 1);
        o--;
        o1.setSelected(true);
        if(o == 0){
            o1.setVisibility(View.INVISIBLE);
        count--;
        }
        
            break;
           }
if(count == 0){
Intent intent = new Intent(this,Levelthree.class);
intent.putExtra("time",timer);
intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
startActivity(intent);
overridePendingTransition(0,0);
}
}
//타이머를 처리하기 위해 핸들러 객체 생성
 
   
 
}
 
AudioFlinger could not create track, status -12  로그에서 이오류가 납니다... 소리가 났다가 안났다가 거리네요 ;; 
 
익명사용자 님이 2014년 9월 26일 질문

답변 달기

· 글에 소스 코드 보기 좋게 넣는 법
· 질문에 대해 추가적인 질문이나 의견이 있으면 답변이 아니라 댓글로 달아주시기 바랍니다.
표시할 이름 (옵션):
개인정보: 당신의 이메일은 이 알림을 보내는데만 사용됩니다.
스팸 차단 검사:
스팸 검사를 다시 받지 않으려면 로그인하거나 혹은 가입 하세요.
...