class MAGES::Recorder::AudioCapture

Overview

Captures and encodes multiple audio streams. More…

class AudioCapture
{
public:
    // classes

    class AudioStream;
    class Sample;

    // methods

    AudioStream AddStreamByManual(
        int sampleRate,
        MicrophoneEvent.SourceCategory category = MicrophoneEvent.SourceCategory.RemotePlayer,
        string device = null
    );

    AudioStream AddStreamByMicrophone();
    AudioStream AddStreamByAudioSource(AudioSource source);

    void WriteSamples(
        float[] data,
        int offset,
        int count,
        int sampleRate,
        int channels,
        AudioStream stream
    );

    void CloseStream(AudioStream stream);
};

Detailed Documentation

Captures and encodes multiple audio streams.

Methods

AudioStream AddStreamByManual(
    int sampleRate,
    MicrophoneEvent.SourceCategory category = MicrophoneEvent.SourceCategory.RemotePlayer,
    string device = null
)

Adds a manual audio stream.

Parameters:

sampleRate

The sample rate.

category

The source category.

device

The device.

Returns:

The audio stream.

AudioStream AddStreamByMicrophone()

Adds a new audio stream by microphone.

Returns:

The audio stream.

AudioStream AddStreamByAudioSource(AudioSource source)

Adds a new audio stream by audio source.

Parameters:

source

The audio source to use.

Returns:

The audio stream.

void WriteSamples(
    float[] data,
    int offset,
    int count,
    int sampleRate,
    int channels,
    AudioStream stream
)

Writes samples to the audio stream.

Parameters:

data

The samples.

offset

The offset to start writing from.

count

The number of samples to write.

sampleRate

The sample rate of data.

channels

The number of channels.

stream

The audio stream to write the samples to.

void CloseStream(AudioStream stream)

Closes the audio stream.

Parameters:

stream

The audio stream to close.