AudioFileInputNode AudioFileInputNode AudioFileInputNode AudioFileInputNode Class

Represents an audio file input node.

Syntax

Declaration

public sealed class AudioFileInputNodepublic sealed class AudioFileInputNodePublic NotInheritable Class AudioFileInputNode

Remarks

Get an instance of this class by calling CreateFileInputNodeAsync(Windows.Storage.IStorageFile) and then accessing the FileInputNode property.

Properties summary

Gets or sets a value indicating if the audio file input node consumes input.

Gets the duration for the audio input file.

Gets the list of effect definitions for the audio file input node.

Gets the AudioNodeEmitter that describes the position and other physical characteristics of the emitter from which the AudioFileInputNode audio is emitted when spatial audio processing is used.

Gets the encoding properties for the audio file input node.

Gets or sets the end time for the audio file input node.

Gets or sets the loop count of the audio file input node.

Gets the list of outgoing connections from the audio file input node to other nodes in the audio graph.

Gets or sets the outgoing gain for the audio file input node.

Gets or sets the playback speed factor for the audio file input node.

Gets the position of the audio file input node.

Gets the source audio file for the audio file input node.

Gets or sets the start time for the audio file input node.

Methods summary

Adds an outgoing connection to the audio file input node.

Adds an outgoing connection with gain to the audio file input node.

Closes the audio file input node.

Disables all effects in the EffectDefinitions list with the specified effect definition.

Enables all effects in the EffectDefinitions list with the specified effect definition.

Removes the outgoing connection for the audio file input node.

Resets the audio file input node.

Moves the playback position of the node to the specified time within the audio input file.

Starts the audio file input node.

Stops the audio file input node.

Events summary

Notifies of completion of the file associated with the audio file input node.

Properties

  • ConsumeInput
    ConsumeInput
    ConsumeInput
    ConsumeInput

    Gets or sets a value indicating if the audio file input node consumes input.

    public bool ConsumeInput { get; set; }public bool ConsumeInput { get; set; }Public ReadWrite Property ConsumeInput As bool

    Property Value

    • bool
      bool
      bool
      bool

      True if the audio file input node consumes input, and false otherwise.

  • Duration
    Duration
    Duration
    Duration

    Gets the duration for the audio input file.

    public TimeSpan Duration { get; }public TimeSpan Duration { get; }Public ReadOnly Property Duration As TimeSpan

    Property Value

    Remarks

    The Duration property represents the duration of the audio input file. The StartTime and EndTime properties can be used to set the range of the file that is used for playback, but setting these properties does not cause the value returned by Duration to change.

  • EffectDefinitions
    EffectDefinitions
    EffectDefinitions
    EffectDefinitions

    Gets the list of effect definitions for the audio file input node.

    public IVector<IAudioEffectDefinition> EffectDefinitions { get; }public IVector<IAudioEffectDefinition> EffectDefinitions { get; }Public ReadOnly Property EffectDefinitions As IVector<IAudioEffectDefinition>

    Property Value

    • The list of effect definitions for the node.

  • Emitter
    Emitter
    Emitter
    Emitter

    Gets the AudioNodeEmitter that describes the position and other physical characteristics of the emitter from which the AudioFileInputNode audio is emitted when spatial audio processing is used.

    public AudioNodeEmitter Emitter { get; }public AudioNodeEmitter Emitter { get; }Public ReadOnly Property Emitter As AudioNodeEmitter

    Property Value

    Remarks

    Create an AudioFileInputNode with an AudioNodeEmitter by calling the overload of CreateFileInputNodeAsync(Windows.Storage.IStorageFile,Windows.Media.Audio.AudioNodeEmitter) that accepts an emitter as an argument.

  • EncodingProperties
    EncodingProperties
    EncodingProperties
    EncodingProperties

    Gets the encoding properties for the audio file input node.

    public AudioEncodingProperties EncodingProperties { get; }public AudioEncodingProperties EncodingProperties { get; }Public ReadOnly Property EncodingProperties As AudioEncodingProperties

    Property Value

  • EndTime
    EndTime
    EndTime
    EndTime

    Gets or sets the end time for the audio file input node.

    public IReference<TimeSpan> EndTime { get; set; }public IReference<TimeSpan> EndTime { get; set; }Public ReadWrite Property EndTime As IReference<TimeSpan>

    Property Value

    • A value indicating the end time.

    Remarks

    EndTime defines where in the file playback ends. If EndTime is null, playback will end at the end of the file. EndTime can't be set to a time greater than the duration of the file. Attempting to do so will result in an invalid argument error.

  • LoopCount
    LoopCount
    LoopCount
    LoopCount

    Gets or sets the loop count of the audio file input node.

    public IReference<int> LoopCount { get; set; }public IReference<int> LoopCount { get; set; }Public ReadWrite Property LoopCount As IReference<int>

    Property Value

    • A reference to the loop count.

    Remarks

    The LoopCount property specifies the number of times that the node will seek back to the StartTime, or the beginning of the file if StartTime is not set, and replay the content of the file. This value does not include the initial playback of the file, so using the default value of 0 will result in the file being played once, and setting the value to 5 will result in the file being played 6 times in total. Setting this value to null will cause the file to be looped indefinitely. To break out of the infinite loop, set LoopCount back to 0.

  • OutgoingConnections
    OutgoingConnections
    OutgoingConnections
    OutgoingConnections

    Gets the list of outgoing connections from the audio file input node to other nodes in the audio graph.

    public IVectorView<AudioGraphConnection> OutgoingConnections { get; }public IVectorView<AudioGraphConnection> OutgoingConnections { get; }Public ReadOnly Property OutgoingConnections As IVectorView<AudioGraphConnection>

    Property Value

  • OutgoingGain
    OutgoingGain
    OutgoingGain
    OutgoingGain

    Gets or sets the outgoing gain for the audio file input node.

    public double OutgoingGain { get; set; }public double OutgoingGain { get; set; }Public ReadWrite Property OutgoingGain As double

    Property Value

    • double
      double
      double
      double

      The outgoing gain value.

  • PlaybackSpeedFactor
    PlaybackSpeedFactor
    PlaybackSpeedFactor
    PlaybackSpeedFactor

    Gets or sets the playback speed factor for the audio file input node.

    public double PlaybackSpeedFactor { get; set; }public double PlaybackSpeedFactor { get; set; }Public ReadWrite Property PlaybackSpeedFactor As double

    Property Value

    • double
      double
      double
      double

      A value indicating the playback speed factor.

  • Position
    Position
    Position
    Position

    Gets the position of the audio file input node.

    public TimeSpan Position { get; }public TimeSpan Position { get; }Public ReadOnly Property Position As TimeSpan

    Property Value

  • SourceFile
    SourceFile
    SourceFile
    SourceFile

    Gets the source audio file for the audio file input node.

    public StorageFile SourceFile { get; }public StorageFile SourceFile { get; }Public ReadOnly Property SourceFile As StorageFile

    Property Value

  • StartTime
    StartTime
    StartTime
    StartTime

    Gets or sets the start time for the audio file input node.

    public IReference<TimeSpan> StartTime { get; set; }public IReference<TimeSpan> StartTime { get; set; }Public ReadWrite Property StartTime As IReference<TimeSpan>

    Property Value

    • A value indicating the start time.

    Remarks

    StartTime defines where in the file playback begins. If StartTime is null, playback will start at the beginning of the file. StartTime can't be set to a time greater than the duration of the file. Attempting to do so will result in an invalid argument error.

Methods

  • AddOutgoingConnection(Windows.Media.Audio.IAudioNode)
    AddOutgoingConnection(Windows.Media.Audio.IAudioNode)
    AddOutgoingConnection(Windows.Media.Audio.IAudioNode)
    AddOutgoingConnection(Windows.Media.Audio.IAudioNode)

    Adds an outgoing connection to the audio file input node.

    public void AddOutgoingConnection(Windows.Media.Audio.IAudioNode destination)public void AddOutgoingConnection(Windows.Media.Audio.IAudioNode destination)Public Function AddOutgoingConnection(destination As Windows.Media.Audio.IAudioNode) As void

    Parameters

  • AddOutgoingConnection(Windows.Media.Audio.IAudioNode,System.Double)
    AddOutgoingConnection(Windows.Media.Audio.IAudioNode,System.Double)
    AddOutgoingConnection(Windows.Media.Audio.IAudioNode,System.Double)
    AddOutgoingConnection(Windows.Media.Audio.IAudioNode,System.Double)

    Adds an outgoing connection with gain to the audio file input node.

    public void AddOutgoingConnection(Windows.Media.Audio.IAudioNode destination,System.Double gain)public void AddOutgoingConnection(Windows.Media.Audio.IAudioNode destination,System.Double gain)Public Function AddOutgoingConnection(destination As Windows.Media.Audio.IAudioNode,gain As System.Double) As void

    Parameters

    • destination

      The destination node for the connection.

    • gain
      System.Double
      System.Double
      System.Double
      System.Double

      A value indicating the gain associated with the connection.

  • Close()
    Close()
    Close()
    Close()

    Closes the audio file input node.

    public void Close()public void Close()Public Function Close() As void
  • DisableEffectsByDefinition(Windows.Media.Effects.IAudioEffectDefinition)
    DisableEffectsByDefinition(Windows.Media.Effects.IAudioEffectDefinition)
    DisableEffectsByDefinition(Windows.Media.Effects.IAudioEffectDefinition)
    DisableEffectsByDefinition(Windows.Media.Effects.IAudioEffectDefinition)

    Disables all effects in the EffectDefinitions list with the specified effect definition.

    public void DisableEffectsByDefinition(Windows.Media.Effects.IAudioEffectDefinition definition)public void DisableEffectsByDefinition(Windows.Media.Effects.IAudioEffectDefinition definition)Public Function DisableEffectsByDefinition(definition As Windows.Media.Effects.IAudioEffectDefinition) As void

    Parameters

  • EnableEffectsByDefinition(Windows.Media.Effects.IAudioEffectDefinition)
    EnableEffectsByDefinition(Windows.Media.Effects.IAudioEffectDefinition)
    EnableEffectsByDefinition(Windows.Media.Effects.IAudioEffectDefinition)
    EnableEffectsByDefinition(Windows.Media.Effects.IAudioEffectDefinition)

    Enables all effects in the EffectDefinitions list with the specified effect definition.

    public void EnableEffectsByDefinition(Windows.Media.Effects.IAudioEffectDefinition definition)public void EnableEffectsByDefinition(Windows.Media.Effects.IAudioEffectDefinition definition)Public Function EnableEffectsByDefinition(definition As Windows.Media.Effects.IAudioEffectDefinition) As void

    Parameters

  • RemoveOutgoingConnection(Windows.Media.Audio.IAudioNode)
    RemoveOutgoingConnection(Windows.Media.Audio.IAudioNode)
    RemoveOutgoingConnection(Windows.Media.Audio.IAudioNode)
    RemoveOutgoingConnection(Windows.Media.Audio.IAudioNode)

    Removes the outgoing connection for the audio file input node.

    public void RemoveOutgoingConnection(Windows.Media.Audio.IAudioNode destination)public void RemoveOutgoingConnection(Windows.Media.Audio.IAudioNode destination)Public Function RemoveOutgoingConnection(destination As Windows.Media.Audio.IAudioNode) As void

    Parameters

  • Reset()
    Reset()
    Reset()
    Reset()

    Resets the audio file input node.

    public void Reset()public void Reset()Public Function Reset() As void

    Remarks

    This method causes the node to reset the playback position back to the beginning of the file, or to the time specified by the StartTime property if it has been set. Calling this method causes DiscardQueuedFrames() to be called on any audio effects applied to the AudioFileInputNode.

  • Seek(Windows.Foundation.TimeSpan)
    Seek(Windows.Foundation.TimeSpan)
    Seek(Windows.Foundation.TimeSpan)
    Seek(Windows.Foundation.TimeSpan)

    Moves the playback position of the node to the specified time within the audio input file.

    public void Seek(Windows.Foundation.TimeSpan position)public void Seek(Windows.Foundation.TimeSpan position)Public Function Seek(position As Windows.Foundation.TimeSpan) As void

    Parameters

    Remarks

    You can't seek to a time that is greater than the duration of the file. If the StartTime or EndTime properties have been set, you can't seek to a position before the StartTime or after the EndTime. Attempting to do so will result in an illegal argument error.

  • Start()
    Start()
    Start()
    Start()

    Starts the audio file input node.

    public void Start()public void Start()Public Function Start() As void
  • Stop()
    Stop()
    Stop()
    Stop()

    Stops the audio file input node.

    public void Stop()public void Stop()Public Function Stop() As void

Events

  • FileCompleted
    FileCompleted
    FileCompleted
    FileCompleted

    Notifies of completion of the file associated with the audio file input node.

    public event TypedEventHandler FileCompletedpublic event TypedEventHandler FileCompletedPublic Event FileCompleted

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.ThreadingAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.DualApiPartitionAttribute

Details

Assembly

Windows.Media.Audio.dll