mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 04:21:50 +00:00
add device select to audio settings
This commit is contained in:
parent
25808d2b21
commit
88e61125d1
9 changed files with 91 additions and 10 deletions
|
|
@ -79,6 +79,13 @@ ALInputDevice::ALInputDevice(
|
|||
channels(channels),
|
||||
bitsPerSample(bitsPerSample),
|
||||
sampleRate(sampleRate) {
|
||||
const ALCchar* deviceName = alcGetString(device, ALC_CAPTURE_DEVICE_SPECIFIER);
|
||||
|
||||
if (deviceName) {
|
||||
deviceSpecifier = std::string(deviceName);
|
||||
} else {
|
||||
logger.warning() << "could not retrieve input device specifier";
|
||||
}
|
||||
}
|
||||
|
||||
ALInputDevice::~ALInputDevice() {
|
||||
|
|
@ -108,6 +115,10 @@ uint ALInputDevice::getBitsPerSample() const {
|
|||
return bitsPerSample;
|
||||
}
|
||||
|
||||
const std::string& ALInputDevice::getDeviceSpecifier() const {
|
||||
return deviceSpecifier;
|
||||
}
|
||||
|
||||
size_t ALInputDevice::read(char* buffer, size_t bufferSize) {
|
||||
ALCint samplesCount = 0;
|
||||
alcGetIntegerv(device, ALC_CAPTURE_SAMPLES, sizeof(samplesCount), &samplesCount);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue