Show / Hide Table of Contents

    Interface ISound

    An instance of a playing sound. You'll usually use an IAudioClip to play a sound, and control the playing sound from this interface.

    Inherited Members
    ISoundProperties.Volume
    ISoundProperties.Pitch
    ISoundProperties.Panning
    ISoundProperties.Tags
    Namespace: AGS.API
    Assembly: AGS.API.dll
    Syntax
    public interface ISound : ISoundProperties

    Properties

    | Improve this Doc View Source

    Completed

    A task that can be used to await a playing sound asynchronously until it completes (do not use on a looping sound).

    Declaration
    Task Completed { get; }
    Property Value
    Type Description
    System.Threading.Tasks.Task

    The completed.

    Examples
    private async Task onMusicBoxInteract()
    {
        ISound sound = musicBoxAudioClip.Play();
        await cHero.SayAsync("The music box is currently playing a song..."); //We didn't wait for the sound to complete yet, so the character is speaking in parallel
        await sound.Completed;
        await cHero.SayAsync("What a nice song that was!");
    }
    | Improve this Doc View Source

    Duration

    Gets duration of the sound in seconds.

    Declaration
    float Duration { get; }
    Property Value
    Type Description
    System.Single
    | Improve this Doc View Source

    HasCompleted

    Has this ISound completed playing?

    Declaration
    bool HasCompleted { get; }
    Property Value
    Type Description
    System.Boolean

    true if has completed; otherwise, false.

    | Improve this Doc View Source

    IsLooping

    Is this ISound looping (i.e running in an endless loop)?

    Declaration
    bool IsLooping { get; }
    Property Value
    Type Description
    System.Boolean

    true if is looping; otherwise, false.

    | Improve this Doc View Source

    IsPaused

    Is this ISound paused?

    Declaration
    bool IsPaused { get; }
    Property Value
    Type Description
    System.Boolean

    true if is paused; otherwise, false.

    | Improve this Doc View Source

    IsValid

    Is the sound a valid sound and expected to play properly, or is there some audio problem and this is a dummy object?

    Declaration
    bool IsValid { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Position

    Gets or sets the playback position within the sound in seconds.

    Declaration
    float Position { get; set; }
    Property Value
    Type Description
    System.Single

    The position.

    | Improve this Doc View Source

    RealPanning

    Gets the real panning of the sound (after it has been modified by all the existing sound modifiers).

    Declaration
    float RealPanning { get; }
    Property Value
    Type Description
    System.Single

    The real panning.

    See Also
    SoundModifiers
    Panning
    | Improve this Doc View Source

    RealPitch

    Gets the real pitch of the sound (after it has been modified by all the existing sound modifiers).

    Declaration
    float RealPitch { get; }
    Property Value
    Type Description
    System.Single

    The real pitch.

    See Also
    SoundModifiers
    Pitch
    | Improve this Doc View Source

    RealVolume

    Gets the real volume of the sound (after it has been modified by all the existing sound modifiers).

    Declaration
    float RealVolume { get; }
    Property Value
    Type Description
    System.Single

    The real volume.

    See Also
    SoundModifiers
    Volume
    | Improve this Doc View Source

    SoundModifiers

    A list of modifiers for sound properties. The sound modifiers act on the existing sound properties that you set (volume, panning, pitch), and modify them on-the-fly (for example, the engine has a rule where the volume of non-speech sounds is reduced when speech is playing).

    Declaration
    IAGSBindingList<ISoundModifier> SoundModifiers { get; }
    Property Value
    Type Description
    IAGSBindingList<ISoundModifier>

    The list of sound modifiers.

    See Also
    Volume
    Pitch
    Panning
    RealVolume
    RealPitch
    RealPanning
    | Improve this Doc View Source

    SourceID

    An internal id for the source that is playing the sound. This can be used if low-level OpenAL access is needed, but for regular uses can be ignored.

    Declaration
    int SourceID { get; }
    Property Value
    Type Description
    System.Int32

    The source identifier.

    Methods

    | Improve this Doc View Source

    Pause()

    Pause this sound.

    Declaration
    void Pause()
    | Improve this Doc View Source

    Resume()

    Resume this sound (if the sound is already playing, or already completed, then it does nothing).

    Declaration
    void Resume()
    | Improve this Doc View Source

    Rewind()

    Rewind this sound to the beginning (if the sound has already completed, then it does nothing).

    Declaration
    void Rewind()
    | Improve this Doc View Source

    Stop()

    Stop this sound (if the sound has already completed, then it does nothing).

    Declaration
    void Stop()
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX