This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void mixSound() throws IOException { | |
AudioTrack audioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, 44100, AudioFormat.CHANNEL_OUT_STEREO, AudioFormat.ENCODING_PCM_16BIT, 44100, AudioTrack.MODE_STREAM); | |
InputStream in1=getResources().openRawResource(R.raw.track1); | |
InputStream in2=getResources().openRawResource(R.raw.track2); | |
byte[] music1 = null; | |
music1= new byte[in1.available()]; | |
music1=convertStreamToByteArray(in1); | |
in1.close(); |