Vixen
02b45cc4
csharp
public readonly record struct AudioFormat

How many frames a second, across how many channels.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

The pair, and not the sample format, because everything downstream of the decoder is . AudioClip stores bytes so that a shipped clip can be half the size; the mixer converts once on the way in and the rest of the pipeline — resampling, panning, effects, the sum into a bus — never sees an integer again. A format that carried AudioSampleFormat would be describing a decision that has already been taken by the time anybody asks.

A device's format is negotiated, not demanded: OpenDevice is asked for one and Format says what was granted. A clip at a different rate is resampled per voice, which is the only place the conversion can happen given that two clips at two rates can play at once.

Fields and properties (7)

  • public int SampleRate

    Frames per second — 44 100, 48 000.

  • public int Channels

    How many channels are interleaved in one frame.

  • public const int MaxChannels

    The most channels the mixer will render into.

  • public static AudioFormat Mono48k

    One channel at 48 kHz.

  • public static AudioFormat Stereo48k

    Two channels at 48 kHz — what a default device almost always is.

  • public bool IsValid

    Whether this describes something that could actually be rendered.

  • public int SamplesPerFrame

    How many floats one frame takes.

Methods (4)

  • public AudioFormat(int SampleRate, int Channels)

    How many frames a second, across how many channels.

  • public int FramesFor(TimeSpan duration)

    How many frames cover a span of time, rounded up.

  • public TimeSpan DurationOf(long frames)

    How long a number of frames lasts.

  • public override string ToString()

    Returns the fully qualified type name of this instance.

Used by (88, showing 40)

  • PeerVoiceChat
  • VideoGameVideoPlayback
  • AdpcmStreamDecoderVixen.Audio
  • AdpcmTestsVixen.Audio.Tests
  • AudioBusVixen.Audio
  • AudioCaptureOptionsVixen.Audio
  • AudioDeviceInfoVixen.Audio
  • AudioDeviceOptionsVixen.Audio
  • AudioEffectTestsVixen.Audio.Tests
  • AudioEngineVixen.Audio
  • AudioMixerVixen.Audio
  • AudioRoutingTestsVixen.Audio.Tests
  • AudioTestDataVixen.Audio.Tests
  • BiquadFilterEffectVixen.Audio
  • BitCrusherEffectVixen.Audio
  • CaptureSampleProviderVixen.Audio
  • CaptureTestsVixen.Audio.Tests
  • ClipSampleProviderVixen.Audio
  • CodecTestsVixen.Audio.Codecs.Tests
  • CompressorEffectVixen.Audio
  • ConvolutionReverbEffectVixen.Audio
  • ConvolutionTestsVixen.Audio.Tests
  • DelayEffectVixen.Audio
  • DistortionEffectVixen.Audio
  • DynamicsTestsVixen.Audio.Tests
  • EqualizerEffectVixen.Audio
  • FakeProviderVixen.Video.Tests
  • GateEffectVixen.Audio
  • GateTestsVixen.Audio.Tests
  • IAudioCaptureDeviceVixen.Audio
  • IAudioDeviceVixen.Audio
  • IAudioEffectVixen.Audio
  • IAudioPacketDecoderVixen.Video
  • IAudioRenderSourceVixen.Audio
  • IAudioSampleProviderVixen.Audio
  • IAudioStreamDecoderVixen.Audio
  • LimiterEffectVixen.Audio
  • LiveSampleProviderVixen.Audio
  • LiveSampleProviderTestsVixen.Audio.Tests
  • LoudnessMeterEffectVixen.Audio