AudioFrame
AudioFrame
AudioFrame
AudioFrame
Class
Definition
Represents a single frame of audio data.
public : sealed class AudioFrame : IClosable, IAudioFrame, IMediaFramepublic sealed class AudioFrame : IDisposable, IAudioFrame, IMediaFramePublic NotInheritable Class AudioFrame Implements IDisposable, IAudioFrame, IMediaFrame// You can use this class in JavaScript.
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Remarks
An audio frame typically contains multiple audio samples. Access the audio data by calling LockBuffer which returns an AudioBuffer.
Constructors
AudioFrame(UInt32) AudioFrame(UInt32) AudioFrame(UInt32) AudioFrame(UInt32)
Initializes a new instance of the AudioFrame class.
public : AudioFrame(unsigned int capacity)public AudioFrame(UInt32 capacity)Public Sub New(capacity As UInt32)// You can use this method in JavaScript.
- capacity
- unsigned int UInt32 UInt32 UInt32
The maximum number of bytes that the buffer can hold.
Properties
Duration Duration Duration Duration
Gets or sets the duration of the audio frame.
public : IReference<TimeSpan> Duration { get; set; }public Nullable<TimeSpan> Duration { get; set; }Public ReadWrite Property Duration As Nullable<TimeSpan>// You can use this property in JavaScript.
- Value
- IReference<TimeSpan> Nullable<TimeSpan> Nullable<TimeSpan> Nullable<TimeSpan>
The duration of the audio frame.
ExtendedProperties ExtendedProperties ExtendedProperties ExtendedProperties
Gets the extended property set which enables getting and setting properties on the AudioFrame.
public : IPropertySet ExtendedProperties { get; }public IPropertySet ExtendedProperties { get; }Public ReadOnly Property ExtendedProperties As IPropertySet// You can use this property in JavaScript.
The extended properties map.
IsDiscontinuous IsDiscontinuous IsDiscontinuous IsDiscontinuous
Gets or sets a value that indicates whether an audio frame is the first frame after a gap in the stream.
public : PlatForm::Boolean IsDiscontinuous { get; set; }public bool IsDiscontinuous { get; set; }Public ReadWrite Property IsDiscontinuous As bool// You can use this property in JavaScript.
- Value
- PlatForm::Boolean bool bool bool
True if the audio frame is the first frame after a gap in the stream; otherwise, false.
IsReadOnly IsReadOnly IsReadOnly IsReadOnly
Gets a value indicating whether the audio frame is read-only.
public : PlatForm::Boolean IsReadOnly { get; }public bool IsReadOnly { get; }Public ReadOnly Property IsReadOnly As bool// You can use this property in JavaScript.
- Value
- PlatForm::Boolean bool bool bool
True if the audio frame is read-only; otherwise, false.
Remarks
When this value is true, both the audio data and the mutable properties of the audio frame are read-only.
RelativeTime RelativeTime RelativeTime RelativeTime
Gets or sets the relative time of the frame within the audio stream.
public : IReference<TimeSpan> RelativeTime { get; set; }public Nullable<TimeSpan> RelativeTime { get; set; }Public ReadWrite Property RelativeTime As Nullable<TimeSpan>// You can use this property in JavaScript.
- Value
- IReference<TimeSpan> Nullable<TimeSpan> Nullable<TimeSpan> Nullable<TimeSpan>
The relative time of the frame within the audio stream.
Remarks
Use SystemRelativeTime to get a timestamp that is relative to the system and is correlatable across multiple media sources on the same device.
- See Also
SystemRelativeTime SystemRelativeTime SystemRelativeTime SystemRelativeTime
Gets or sets a timestamp that is relative to the system and is correlatable across multiple media sources on the same device.
public : IReference<TimeSpan> SystemRelativeTime { get; set; }public Nullable<TimeSpan> SystemRelativeTime { get; set; }Public ReadWrite Property SystemRelativeTime As Nullable<TimeSpan>// You can use this property in JavaScript.
- Value
- IReference<TimeSpan> Nullable<TimeSpan> Nullable<TimeSpan> Nullable<TimeSpan>
A timestamp relative to the system.
Remarks
Use RelativeTime to get a timestamp that is relative to the audio stream.
Type Type Type Type
Gets a string indicating the type of audio data the audio frame contains.
public : PlatForm::String Type { get; }public string Type { get; }Public ReadOnly Property Type As string// You can use this property in JavaScript.
- Value
- PlatForm::String string string string
A string indicating the type of audio data the audio frame contains.
Methods
Close() Close() Close() Close()
Disposes of the object and associated resources.
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.
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()
LockBuffer(AudioBufferAccessMode) LockBuffer(AudioBufferAccessMode) LockBuffer(AudioBufferAccessMode) LockBuffer(AudioBufferAccessMode)
Gets a AudioBuffer object that allows you to operate directly on the software bitmap's pixel data.
public : AudioBuffer LockBuffer(AudioBufferAccessMode mode)public AudioBuffer LockBuffer(AudioBufferAccessMode mode)Public Function LockBuffer(mode As AudioBufferAccessMode) As AudioBuffer// You can use this method in JavaScript.
A value indicating the access mode of the returned audio buffer.
The buffer containing pixel data.