mirror of
https://github.com/celisej567/abaddon.git
synced 2026-09-06 20:15:19 +03:00
only enable microphone when in a voice channel
This commit is contained in:
@@ -98,13 +98,6 @@ AudioManager::AudioManager() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ma_device_start(&m_capture_device) != MA_SUCCESS) {
|
||||
puts("failed to start capture");
|
||||
ma_device_uninit(&m_capture_device);
|
||||
m_ok = false;
|
||||
return;
|
||||
}
|
||||
|
||||
char device_name[MA_MAX_DEVICE_NAME_LENGTH + 1];
|
||||
ma_device_get_name(&m_capture_device, ma_device_type_capture, device_name, sizeof(device_name), nullptr);
|
||||
printf("using %s for capture\n", device_name);
|
||||
@@ -168,6 +161,18 @@ void AudioManager::FeedMeOpus(uint32_t ssrc, const std::vector<uint8_t> &data) {
|
||||
}
|
||||
}
|
||||
|
||||
void AudioManager::StartCaptureDevice() {
|
||||
if (ma_device_start(&m_capture_device) != MA_SUCCESS) {
|
||||
puts("failed to start capture");
|
||||
}
|
||||
}
|
||||
|
||||
void AudioManager::StopCaptureDevice() {
|
||||
if (ma_device_stop(&m_capture_device) != MA_SUCCESS) {
|
||||
puts("failed to stop capture");
|
||||
}
|
||||
}
|
||||
|
||||
void AudioManager::SetCapture(bool capture) {
|
||||
m_should_capture = capture;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user