AudioSource play certain time range?

I have audio files containing several lines of dialogue each and I want to play just one phrase / line. Is it possible to play, for example, only 13.21 - 14.57 seconds into the AudioClip instantly?

AudioSource.time is get only, so I don’t see any other options for setting the offset for which a AudioSource starts at.

I know how to wait and stop the sound, I just need to know how to play from an offset of seconds or samples. (C#)

AudioSource.time is not get only, you can also set time using time property and seek starting time wherever you want.

If I understand your question properly then following should work :

void Start()
{
        audioSource.time = 13.21f;   // assuming that you already have reference to your AudioSource
        audioSource.Play();
}

void Update()
{
        if(audioSource.time > 14.57f){
                audioSource.Stop();
        }
}

@NibblesMeKibbles Try following 3 lines in order it works.

audioSource.time = 13.21f
audioSource.Play();
audioSource.SetScheduledEndTime(AudioSettings.dspTime+(14.57f-13.21f));

Used @kalanadis 's answer to make a new component, AudioSource is a sealed class, so I can’t inherit from it. Anyone can make it easier to use ?

using UnityEngine;

[RequireComponent(typeof(AudioSource))]
public class AudioSourceEx : MonoBehaviour
{
    public float fromSeconds;
    public float toSeconds;
    private AudioSource audioSource;

    private void Awake()
    {
        audioSource = GetComponent<AudioSource>();
    }
    
    public void Play()
    {
        audioSource.time = fromSeconds;
        audioSource.Play();
        
        if (toSeconds > 0 && toSeconds > fromSeconds)
            audioSource.SetScheduledEndTime(AudioSettings.dspTime + (toSeconds - fromSeconds));
    }
}