playing a random short array in AudioTrack results nothing
<p>I want to know how Audiotrack works, so I generated a random short array with length 60000, and tried to play it with AudioTrack:</p>

<pre><code>public short[] generatedNoise=new short[60000];
for(int i=0;i&lt;=59999;i++){
                generatedNoise[i]=(short) random.nextInt(Short.MAX_VALUE + 1);
            }
AudioTrack  at=new AudioTrack(AudioManager.STREAM_MUSIC, 48000, AudioFormat.CHANNEL_OUT_MONO,
                        AudioFormat.ENCODING_PCM_16BIT, 48000*7 /* 1 second buffer */,
                        AudioTrack.MODE_STREAM);
                at.write(generatedNoise, 0, generatedNoise.length);
                at.play();      
</code></pre>

<p>But the speaker outputs nothing, and there is no error message in my console. I tried using this method playing a wav file and it works perfect, can someone tell me the reason? My objective is to output some noise from the speaker.</p>

<p>Update: I just generated a short array like with the following code and still get not output:</p>

<pre><code>          short[] wave=new short[100000];

          int i=0;
          while(i&lt;=99997){
              wave[i]=32767;
              wave[i+1]=0;
              wave[i+2]=-32767;
              wave[i+3]=0;
              i=i+4;
          }
</code></pre>
