2024-10-03 23:24:34 +02:00
|
|
|
#include "AudioDevice.hpp"
|
|
|
|
|
#include "orbis/utils/Logs.hpp"
|
|
|
|
|
|
2024-10-04 15:45:19 +02:00
|
|
|
void AudioDevice::setFormat(AudioFormat format) {
|
2024-10-03 23:24:34 +02:00
|
|
|
if (mWorking)
|
|
|
|
|
return;
|
|
|
|
|
mFormat = format;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AudioDevice::setFrequency(orbis::uint frequency) {
|
|
|
|
|
if (mWorking)
|
|
|
|
|
return;
|
|
|
|
|
mFrequency = frequency;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AudioDevice::setChannels(orbis::ushort channels) {
|
|
|
|
|
if (mWorking)
|
|
|
|
|
return;
|
|
|
|
|
if (channels > 8) {
|
|
|
|
|
ORBIS_LOG_FATAL("Channels count is not supported", channels);
|
|
|
|
|
std::abort();
|
|
|
|
|
}
|
|
|
|
|
mChannels = channels;
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-04 15:45:19 +02:00
|
|
|
void AudioDevice::setSampleSize(orbis::uint sampleSize,
|
|
|
|
|
orbis::uint sampleCount) {
|
2024-10-03 23:24:34 +02:00
|
|
|
if (mWorking)
|
|
|
|
|
return;
|
|
|
|
|
mSampleSize = sampleSize;
|
|
|
|
|
mSampleCount = sampleCount;
|
|
|
|
|
}
|