#define MA_DATA_FORMAT_FLAG_EXCLUSIVE_MODE (1U << 1); /* If set, this is supported in exclusive mode. Otherwise not natively supported by exclusive mode. */
typedefstruct
{
/* Basic info. This is the only information guaranteed to be filled in during device enumeration. */
ma_device_idid;
charname[256];
ma_bool32isDefault;
/*
Detailed info. As much of this is filled as possible with ma_context_get_device_info(). Note that you are allowed to initialize
...
...
@@ -1707,13 +1821,19 @@ typedef struct
ma_uint32minSampleRate;
ma_uint32maxSampleRate;
/* Experimental. Don't use these right now. */
ma_uint32nativeDataFormatCount;
struct
{
ma_bool32isDefault;
}_private;
ma_formatformat;/* Sample format. If set to ma_format_unknown, all sample formats are supported. */
ma_uint32channels;/* If set to 0, all channels are supported. */
ma_uint32sampleRate;/* If set to 0, all sample rates are supported. */
ma_uint32flags;
}nativeDataFormats[64];
}ma_device_info;
typedefstruct
structma_device_config
{
ma_device_typedeviceType;
ma_uint32sampleRate;
...
...
@@ -1774,9 +1894,146 @@ typedef struct
constchar*pStreamNamePlayback;
constchar*pStreamNameCapture;
}pulse;
}ma_device_config;
struct
{
ma_bool32allowNominalSampleRateChange;/* Desktop only. When enabled, allows changing of the sample rate at the operating system level. */
}coreaudio;
struct
{
ma_opensl_stream_typestreamType;
ma_opensl_recording_presetrecordingPreset;
}opensl;
struct
{
ma_aaudio_usageusage;
ma_aaudio_content_typecontentType;
ma_aaudio_input_presetinputPreset;
}aaudio;
};
/*
The callback for handling device enumeration. This is fired from `ma_context_enumerated_devices()`.
Parameters
----------
pContext (in)
A pointer to the context performing the enumeration.
deviceType (in)
The type of the device being enumerated. This will always be either `ma_device_type_playback` or `ma_device_type_capture`.
pInfo (in)
A pointer to a `ma_device_info` containing the ID and name of the enumerated device. Note that this will not include detailed information about the device,
only basic information (ID and name). The reason for this is that it would otherwise require opening the backend device to probe for the information which
is too inefficient.
pUserData (in)
The user data pointer passed into `ma_context_enumerate_devices()`.
The callback for handling device enumeration. This is fired from `ma_context_enumerated_devices()`.
Parameters
----------
pContext (in)
A pointer to the context performing the enumeration.
deviceType (in)
The type of the device being enumerated. This will always be either `ma_device_type_playback` or `ma_device_type_capture`.
pInfo (in)
A pointer to a `ma_device_info` containing the ID and name of the enumerated device. Note that this will not include detailed information about the device,
only basic information (ID and name). The reason for this is that it would otherwise require opening the backend device to probe for the information which
is too inefficient.
pUserData (in)
The user data pointer passed into `ma_context_enumerate_devices()`.
ma_bool32isBackendAsynchronous:1;/* Set when the context is initialized. Set to 1 for asynchronous backends such as Core Audio and JACK. Do not modify. */
ma_result(*onEnumDevices)(ma_context*pContext,ma_enum_devices_callback_proccallback,void*pUserData);/* Return false from the callback to stop enumeration. */
#pragma GCC diagnostic pop /* For ISO C99 doesn't support unnamed structs/unions [-Wpedantic] */
#endif
...
...
@@ -2570,7 +2817,7 @@ The context can be configured via the `pConfig` argument. The config object is i
can then be set directly on the structure. Below are the members of the `ma_context_config` object.
logCallback
Callback for handling log messages from miniaudio.
Callback for handling log messages from miniaudio.
threadPriority
The desired priority to use for the audio thread. Allowable values include the following:
...
...
@@ -3144,7 +3391,7 @@ then be set directly on the structure. Below are the members of the `ma_device_c
ma_share_mode_shared and reinitializing.
wasapi.noAutoConvertSRC
WASAPI only. When set to true, disables WASAPI's automatic resampling and forces the use of miniaudio's resampler. Defaults to false.
WASAPI only. When set to true, disables WASAPI's automatic resampling and forces the use of miniaudio's resampler. Defaults to false.
wasapi.noDefaultQualitySRC
WASAPI only. Only used when `wasapi.noAutoConvertSRC` is set to false. When set to true, disables the use of `AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY`.
...
...
@@ -3174,6 +3421,13 @@ then be set directly on the structure. Below are the members of the `ma_device_c
pulse.pStreamNameCapture
PulseAudio only. Sets the stream name for capture.
coreaudio.allowNominalSampleRateChange
Core Audio only. Desktop only. When enabled, allows the sample rate of the device to be changed at the operating system level. This
is disabled by default in order to prevent intrusive changes to the user's system. This is useful if you want to use a sample rate
that is known to be natively supported by the hardware thereby avoiding the cost of resampling. When set to true, miniaudio will
find the closest match between the sample rate requested in the device config and the sample rates natively supported by the
hardware. When set to false, the sample rate currently set by the operating system will always be used.
Once initialized, the device's config is immutable. If you need to change the config you will need to initialize a new device.