AudioFileInputNode AudioFileInputNode AudioFileInputNode AudioFileInputNode Class

Definition

Represents an audio file input node.

public : sealed class AudioFileInputNode : IClosable, IAudioFileInputNode, IAudioInputNode, IAudioInputNode2, IAudioNodepublic sealed class AudioFileInputNode : IDisposable, IAudioFileInputNode, IAudioInputNode, IAudioInputNode2, IAudioNodePublic NotInheritable Class AudioFileInputNode Implements IDisposable, IAudioFileInputNode, IAudioInputNode, IAudioInputNode2, IAudioNode// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Get an instance of this class by calling AudioGraph::CreateFileInputNodeAsync and then accessing the CreateFileInputNodeResult::FileInputNode property.

Properties

ConsumeInput ConsumeInput ConsumeInput ConsumeInput

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

public : PlatForm::Boolean ConsumeInput { get; set; }public bool ConsumeInput { get; set; }Public ReadWrite Property ConsumeInput As bool// You can use this property in JavaScript.
Value
PlatForm::Boolean 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// You can use this property in JavaScript.
Value
TimeSpan TimeSpan TimeSpan TimeSpan

A value indicating the duration for the audio input file.

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 IList<IAudioEffectDefinition> EffectDefinitions { get; }Public ReadOnly Property EffectDefinitions As IList<IAudioEffectDefinition>// You can use this property in JavaScript.
Value
IVector<IAudioEffectDefinition> IList<IAudioEffectDefinition> IList<IAudioEffectDefinition> IList<IAudioEffectDefinition>

The list of effect definitions for the node.

See Also

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// You can use this property in JavaScript.
Value
AudioNodeEmitter AudioNodeEmitter AudioNodeEmitter AudioNodeEmitter

The spatial audio emitter associated with the AudioFileInputNode.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

Create an AudioFileInputNode with an AudioNodeEmitter by calling the overload of CreateFileInputNodeAsync 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// You can use this property in JavaScript.

EndTime EndTime EndTime EndTime

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

public : IReference<TimeSpan> EndTime { get; set; }public Nullable<TimeSpan> EndTime { get; set; }Public ReadWrite Property EndTime As Nullable<TimeSpan>// You can use this property in JavaScript.
Value
IReference<TimeSpan> Nullable<TimeSpan> Nullable<TimeSpan> Nullable<TimeSpan>

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 Nullable<int> LoopCount { get; set; }Public ReadWrite Property LoopCount As Nullable<int>// You can use this property in JavaScript.
Value
IReference<int> Nullable<int> Nullable<int> Nullable<int>

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 IReadOnlyList<AudioGraphConnection> OutgoingConnections { get; }Public ReadOnly Property OutgoingConnections As IReadOnlyList<AudioGraphConnection>// You can use this property in JavaScript.
Value
IVectorView<AudioGraphConnection> IReadOnlyList<AudioGraphConnection> IReadOnlyList<AudioGraphConnection> IReadOnlyList<AudioGraphConnection>

A collection of AudioGraphConnection objects representing the supported connections.

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// You can use this property in JavaScript.
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// You can use this property in JavaScript.
Value
double double double double

A value indicating the playback speed factor.

Remarks

This is a linear scale of the playback speed. So, for example a value of .5 will result in half-speed playback and a value of 2.0 will play the audio file back at double speed.

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// You can use this property in JavaScript.
Value
TimeSpan TimeSpan TimeSpan TimeSpan

The current playback position within the audio file, in seconds.

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// You can use this property in JavaScript.
Value
StorageFile StorageFile StorageFile StorageFile

A StorageFile object representing the source audio file.

StartTime StartTime StartTime StartTime

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

public : IReference<TimeSpan> StartTime { get; set; }public Nullable<TimeSpan> StartTime { get; set; }Public ReadWrite Property StartTime As Nullable<TimeSpan>// You can use this property in JavaScript.
Value
IReference<TimeSpan> Nullable<TimeSpan> Nullable<TimeSpan> Nullable<TimeSpan>

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(IAudioNode) AddOutgoingConnection(IAudioNode) AddOutgoingConnection(IAudioNode) AddOutgoingConnection(IAudioNode)

Adds an outgoing connection to the audio file input node.

public : void AddOutgoingConnection(IAudioNode destination)public void AddOutgoingConnection(IAudioNode destination)Public Function AddOutgoingConnection(destination As IAudioNode) As void// You can use this method in JavaScript.
Parameters
destination
IAudioNode IAudioNode IAudioNode IAudioNode

The destination node for the connection.

See Also

AddOutgoingConnection(IAudioNode, Double) AddOutgoingConnection(IAudioNode, Double) AddOutgoingConnection(IAudioNode, Double) AddOutgoingConnection(IAudioNode, Double)

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

public : void AddOutgoingConnection(IAudioNode destination, double gain)public void AddOutgoingConnection(IAudioNode destination, Double gain)Public Function AddOutgoingConnection(destination As IAudioNode, gain As Double) As void// You can use this method in JavaScript.
Parameters
destination
IAudioNode IAudioNode IAudioNode IAudioNode

The destination node for the connection.

gain
double Double Double Double

A value indicating the gain associated with the connection.

See Also

Close() Close() Close() Close()

Closes the audio file input node.

public : void Close()This member is not implemented in C#This member is not implemented in VB.Net// You can use this method in JavaScript.

DisableEffectsByDefinition(IAudioEffectDefinition) DisableEffectsByDefinition(IAudioEffectDefinition) DisableEffectsByDefinition(IAudioEffectDefinition) DisableEffectsByDefinition(IAudioEffectDefinition)

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

public : void DisableEffectsByDefinition(IAudioEffectDefinition definition)public void DisableEffectsByDefinition(IAudioEffectDefinition definition)Public Function DisableEffectsByDefinition(definition As IAudioEffectDefinition) As void// You can use this method in JavaScript.
Parameters
definition
IAudioEffectDefinition IAudioEffectDefinition IAudioEffectDefinition IAudioEffectDefinition

The effect definition of the effects to disable.

Dispose() Dispose() Dispose() Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

This member is not implemented in C++void Dispose()Sub Disposevoid Dispose()

EnableEffectsByDefinition(IAudioEffectDefinition) EnableEffectsByDefinition(IAudioEffectDefinition) EnableEffectsByDefinition(IAudioEffectDefinition) EnableEffectsByDefinition(IAudioEffectDefinition)

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

public : void EnableEffectsByDefinition(IAudioEffectDefinition definition)public void EnableEffectsByDefinition(IAudioEffectDefinition definition)Public Function EnableEffectsByDefinition(definition As IAudioEffectDefinition) As void// You can use this method in JavaScript.
Parameters
definition
IAudioEffectDefinition IAudioEffectDefinition IAudioEffectDefinition IAudioEffectDefinition

The effect definition of the effects to enable.

RemoveOutgoingConnection(IAudioNode) RemoveOutgoingConnection(IAudioNode) RemoveOutgoingConnection(IAudioNode) RemoveOutgoingConnection(IAudioNode)

Removes the outgoing connection for the audio file input node.

public : void RemoveOutgoingConnection(IAudioNode destination)public void RemoveOutgoingConnection(IAudioNode destination)Public Function RemoveOutgoingConnection(destination As IAudioNode) As void// You can use this method in JavaScript.
Parameters
destination
IAudioNode IAudioNode IAudioNode IAudioNode

The destination for the outgoing connection.

Reset() Reset() Reset() Reset()

Resets the audio file input node.

public : void Reset()public void Reset()Public Function Reset() As void// You can use this method in JavaScript.

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(TimeSpan) Seek(TimeSpan) Seek(TimeSpan) Seek(TimeSpan)

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

public : void Seek(TimeSpan position)public void Seek(TimeSpan position)Public Function Seek(position As TimeSpan) As void// You can use this method in JavaScript.
Parameters
position
TimeSpan TimeSpan TimeSpan TimeSpan

A value indicating the position to which the node should seek.

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// You can use this method in JavaScript.

Remarks

Audio graph nodes are created in the started state by default and will start processing audio when AudioGraph.Start is called. This method will restart processing for a node that was stopped with a call to Stop.

Stop() Stop() Stop() Stop()

Stops the audio file input node.

public : void Stop()public void Stop()Public Function Stop() As void// You can use this method in JavaScript.

Remarks

To stop all processing for all nodes of the graph, call AudioGraph.Stop.

Events

FileCompleted FileCompleted FileCompleted FileCompleted

Occurs when the playback position reaches the end of the audio file associated with the audio file input node.

public : event TypedEventHandler FileCompleted<AudioFileInputNode,  object>public event TypedEventHandler FileCompleted<AudioFileInputNode,  object>Public Event FileCompleted<AudioFileInputNode,  object>// You can use this event in JavaScript.

See Also