Code example for AudioTrack

Methods: getPlaybackHeadPosition

0
        audiotrack_.stop();
    } 
 
    public int getHeadPosition() 
    { 
        return audiotrack_.getPlaybackHeadPosition();
    } 
 
    /// Write audio data to audio hardware for playback. 
    /// @param audioData Audio data 
    /// @param offsetInShorts Offset in audioData where to start reading 
    /// @param sizeInShorts How many values to read following offset 
    public void write(short[] audioData, int offsetInShorts, int sizeInShorts)
    { 
        audiotrack_.write(audioData, offsetInShorts, sizeInShorts);
    } 
}