Android AudioTrack cannot be INITIALIZED
<p>I have a problem with initializing android AudioTrack.  I have Nexus One with android 2.3.3.</p>

<p>Here is my code:</p>

<p>int _rate = AudioTrack.getNativeOutputSampleRate(AudioManager.STREAM_SYSTEM);</p>

<p>int buffersize = AudioRecord.getMinBufferSize(_rate,
                    AudioFormat.CHANNEL_IN_MONO,
                    AudioFormat.ENCODING_PCM_16BIT);</p>

<p>AudioTrack atrack = new AudioTrack(AudioManager.STREAM_VOICE_CALL,
                _rate,
                    AudioFormat.CHANNEL_OUT_MONO,
                    AudioFormat.ENCODING_PCM_16BIT,
                    buffersize,
                    AudioTrack.MODE_STREAM);</p>

<p>if (atrack.getState() == AudioTrack.STATE_UNINITIALIZED)
...</p>

<p>So the state of the atrack is always AudioTrack.STATE_UNINITIALIZED</p>

<p>The application manifest is </p>

<p>
</p>

<pre><code>&lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt;
    &lt;activity android:name="BigLeftEarActivity"
              android:label="@string/app_name"&gt;
        &lt;intent-filter&gt;
            &lt;action android:name="android.intent.action.MAIN" /&gt;
            &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
        &lt;/intent-filter&gt;
    &lt;/activity&gt;

&lt;/application&gt;

&lt;uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"&gt;&lt;/uses-permission&gt;
&lt;uses-permission android:name="android.permission.BLUETOOTH"&gt;&lt;/uses-permission&gt;
&lt;uses-permission android:name="android.permission.RECORD_AUDIO"&gt;&lt;/uses-permission&gt;

&lt;uses-sdk android:minSdkVersion="10" /&gt; 
</code></pre>

<p></p>

<p>Could you help me?  What could be wrong?</p>

<p>Thanks!</p>
