This is a bit of a disappointing answer, but through all my research into the matter it is impossible using the current unity system. However, not all is lost! The functions to do it exist in the unity engine but are not in a working state (they are new as of 3.5, latest build if I am correct) but how you would do the code would look something like this (once they get it working).
var AudioClipStart : AudioClip; //This is an audio file (compressed MP3 in this example) that we will modify. This will be set using the unity editor.
private var AudioClipNew : AudioClip; //This is what the modified clip will be saved as, and we will then play it.
function Start() {
var samples = new float[AudioClipStart.samples * AudioClipStart.channels]; //Build a list of all the sound data in the audio clip based on the original.
var TimeReal : float = AudioClipStart.length; //The number we will use to offset the audioclip will not actually be in seconds, it will be in the segments the compression slices it into.
var SegmentNumber : int = AudioClipStart.samples; //This is the actual number of segments of the audio clip.
var TimePerSegment = TimeReal/SegmentNumber;
AudioClipStart.GetData(samples, 20 / TimePerSegment); //Pull the data from the clip with an offset of 20 seconds. We devide by the time per second to actually offset by a perfect 20 seconds instead of something shorter or longer.
AudioClipNew.SetData(samples, 0); //We pulled the data from the original with an offset of 20 seconds, now we apply it to the new with no offset, making this audio clip 20 seconds ahead of the original.
audio.clip = AudioClipNew; //Set the audio source's clip to the new audioclip.
audio.Play(); //Play the audio and hear the effect.
}
Sadly this code doesn’t work because the key components of it (AudioClip.GetData(data : float,Offset : int) and AudioClip.SetData(data : float,Offset : int)) are non operational. I would recommend asking unity to fix this by the next version.