mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-23 11:38:37 +00:00
comments
This commit is contained in:
parent
89fe0f11ae
commit
ec44103d20
@ -82,7 +82,7 @@ let delays = {};
|
|||||||
const maxfeedback = 0.98;
|
const maxfeedback = 0.98;
|
||||||
|
|
||||||
let channelMerger, destinationGain;
|
let channelMerger, destinationGain;
|
||||||
|
//update the output channel configuration to match user's audio device
|
||||||
export function initializeAudioOutput() {
|
export function initializeAudioOutput() {
|
||||||
const audioContext = getAudioContext();
|
const audioContext = getAudioContext();
|
||||||
const maxChannelCount = audioContext.destination.maxChannelCount;
|
const maxChannelCount = audioContext.destination.maxChannelCount;
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import { getAudioContext, initializeAudioOutput } from '@strudel.cycles/webaudio
|
|||||||
import { SelectInput } from './SelectInput';
|
import { SelectInput } from './SelectInput';
|
||||||
|
|
||||||
const initdevices = new Map();
|
const initdevices = new Map();
|
||||||
|
// Allows the user to select an audio interface for Strudel to play through
|
||||||
export function AudioDeviceSelector({ audioDeviceName, onChange }) {
|
export function AudioDeviceSelector({ audioDeviceName, onChange }) {
|
||||||
const [devices, setDevices] = useState(initdevices);
|
const [devices, setDevices] = useState(initdevices);
|
||||||
const devicesInitialized = devices.size > 0;
|
const devicesInitialized = devices.size > 0;
|
||||||
@ -24,6 +25,7 @@ export function AudioDeviceSelector({ audioDeviceName, onChange }) {
|
|||||||
return devicesMap;
|
return devicesMap;
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
// on first load, check if there is a cached audio device name in settings and initialize it
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!audioDeviceName.length || devicesInitialized) {
|
if (!audioDeviceName.length || devicesInitialized) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user