(1) MP3 재생 방법
1) MP3 파일 저장
- res/raw 폴더 내에 MP3 파일 Import
Ex> 파일명 : mp3_file.mp3
2) 재생
3) 재생 멈추고 처음부터 다시 재생
(2) MP3 재생 시, Status Diagram
(3) 참고 자료
http://developer.android.com/reference/android/media/MediaPlayer.html
1) MP3 파일 저장
- res/raw 폴더 내에 MP3 파일 Import
Ex> 파일명 : mp3_file.mp3
2) 재생
MediaPlayer mp = MediaPlayer.create(ActTeacherIntro.this, R.raw.mp3_file); mp.start(); |
3) 재생 멈추고 처음부터 다시 재생
mp.stop(); try { mp.prepare(); } catch (IllegalStateException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } mp.start(); |
(2) MP3 재생 시, Status Diagram
(3) 참고 자료
http://developer.android.com/reference/android/media/MediaPlayer.html
'컴퓨터 > Android' 카테고리의 다른 글
Android]Error geneating final archive : invalid entry CRC (0) | 2010.06.20 |
---|---|
Android]특정 URL로 Web Browser 실행(Hyper Link) (0) | 2010.06.20 |
Android]emulator: ERROR: the user data image is used by another emulator. aborting (0) | 2010.06.20 |
Android]You must perform a full uninstall of the application. (1) | 2010.06.17 |
Android]Error generating final archive: Debug certificate expired on (7) | 2010.06.17 |