Skip to content

Commit

Permalink
test: volume fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Saelmala committed Jan 17, 2025
1 parent 57fbf20 commit c835154
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
6 changes: 1 addition & 5 deletions src/components/calls-page/calls-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@ export const CallsPage = () => {
}
}, [calls, isProgramOutputAdded]);

useEffect(() => {
console.log("IS SOMEONE SPEAKING: ", isSomeoneSpeaking);
}, [isSomeoneSpeaking]);

const startTimeoutRef = useRef<NodeJS.Timeout | null>(null);

useEffect(() => {
Expand Down Expand Up @@ -129,7 +125,7 @@ export const CallsPage = () => {
}, [isSomeoneSpeaking, shouldReduceVolume]);

useEffect(() => {
console.log("IS AUDIO ACTIVE CALLS PAGE: ", shouldReduceVolume);
console.log("SHOULD REDUCE VOLUME CALLS PAGE: ", shouldReduceVolume);
}, [shouldReduceVolume]);

useEffect(() => {
Expand Down
9 changes: 2 additions & 7 deletions src/components/production-line/production-line.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -351,26 +351,21 @@ export const ProductionLine = ({
if (!line?.programOutputLine) return;

if (shouldReduceVolume && !hasReduced) {
console.log("BASE VOLUME 1: ", value);
setHasReduced(true);

audioElements?.forEach((audioElement) => {
// eslint-disable-next-line no-param-reassign
audioElement.volume = value * volumeChangeFactor;
console.log(
"VOLUME REDUCTION (INSIDE AUDIOELEMENT): ",
audioElement.volume
);
console.log("AUDIO FEED VOLUME REDUCED TO: ", audioElement.volume);
});
}

if (!shouldReduceVolume && hasReduced) {
console.log("BASE VOLUME 2: ", value);
finalIncreaseTimeoutRef.current = setTimeout(() => {
audioElements?.forEach((audioElement) => {
// eslint-disable-next-line no-param-reassign
audioElement.volume = value;
console.log("VOLUME INCREASE: ", audioElement.volume);
console.log("AUDIO FEED VOLUME INCREASED TO: ", audioElement.volume);
});
setHasReduced(false);
}, 3000);
Expand Down

0 comments on commit c835154

Please sign in to comment.