Code example for AudioTrack

Methods: getPlaybackHeadPosition

0
     * Called on the listener to periodically notify it that the playback head 
     * has reached a multiple of the notification period.  
     */ 
    public void onPeriodicNotification( AudioTrack track ) {
        if (playerCallback != null) {
            int buffered = writtenTotal - track.getPlaybackHeadPosition()*channels;
            int ms = samplesToMs( buffered, sampleRate, channels );
 
            playerCallback.playerPCMFeedBuffer( isPlaying, ms, bufferSizeInMs );
        } 
    } 
 
 
    //////////////////////////////////////////////////////////////////////////// 
    // Runnable 
    //////////////////////////////////////////////////////////////////////////// 
 
    /** 
     * The main execution loop which should be executed in its own thread. 
     */ 
    public void run() {