audio-channel-queue 1.12.1-beta.2 → 1.12.1-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.js +3 -2
- package/dist/volume.js +2 -2
- package/package.json +1 -1
- package/src/core.ts +6 -4
- package/src/volume.ts +2 -2
package/dist/core.js
CHANGED
|
@@ -318,9 +318,10 @@ const playAudioQueue = (channelNumber) => __awaiter(void 0, void 0, void 0, func
|
|
|
318
318
|
if (!channel || channel.queue.length === 0)
|
|
319
319
|
return;
|
|
320
320
|
const currentAudio = channel.queue[0];
|
|
321
|
-
// Apply channel volume if not already set
|
|
321
|
+
// Apply channel volume with global volume multiplier if not already set
|
|
322
322
|
if (currentAudio.volume === 1.0 && channel.volume !== undefined) {
|
|
323
|
-
|
|
323
|
+
const globalVolume = (0, volume_1.getGlobalVolume)();
|
|
324
|
+
currentAudio.volume = channel.volume * globalVolume;
|
|
324
325
|
}
|
|
325
326
|
(0, events_1.setupProgressTracking)(currentAudio, channelNumber, info_1.audioChannels);
|
|
326
327
|
// Apply volume ducking when audio starts
|
package/dist/volume.js
CHANGED
|
@@ -610,8 +610,8 @@ const initializeWebAudioForAudio = (audio, channelNumber) => __awaiter(void 0, v
|
|
|
610
610
|
const nodes = (0, web_audio_1.createWebAudioNodes)(audio, channel.webAudioContext);
|
|
611
611
|
if (nodes) {
|
|
612
612
|
channel.webAudioNodes.set(audio, nodes);
|
|
613
|
-
// Set initial volume to match channel volume
|
|
614
|
-
nodes.gainNode.gain.value = channel.volume;
|
|
613
|
+
// Set initial volume to match channel volume with global volume multiplier
|
|
614
|
+
nodes.gainNode.gain.value = channel.volume * globalVolume;
|
|
615
615
|
}
|
|
616
616
|
}
|
|
617
617
|
});
|
package/package.json
CHANGED
package/src/core.ts
CHANGED
|
@@ -14,10 +14,11 @@ import {
|
|
|
14
14
|
} from './events';
|
|
15
15
|
import {
|
|
16
16
|
applyVolumeDucking,
|
|
17
|
-
restoreVolumeLevels,
|
|
18
17
|
cancelVolumeTransition,
|
|
18
|
+
cleanupWebAudioForAudio,
|
|
19
|
+
getGlobalVolume,
|
|
19
20
|
initializeWebAudioForAudio,
|
|
20
|
-
|
|
21
|
+
restoreVolumeLevels
|
|
21
22
|
} from './volume';
|
|
22
23
|
import { setupAudioErrorHandling, handleAudioError } from './errors';
|
|
23
24
|
|
|
@@ -372,9 +373,10 @@ export const playAudioQueue = async (channelNumber: number): Promise<void> => {
|
|
|
372
373
|
|
|
373
374
|
const currentAudio: HTMLAudioElement = channel.queue[0];
|
|
374
375
|
|
|
375
|
-
// Apply channel volume if not already set
|
|
376
|
+
// Apply channel volume with global volume multiplier if not already set
|
|
376
377
|
if (currentAudio.volume === 1.0 && channel.volume !== undefined) {
|
|
377
|
-
|
|
378
|
+
const globalVolume: number = getGlobalVolume();
|
|
379
|
+
currentAudio.volume = channel.volume * globalVolume;
|
|
378
380
|
}
|
|
379
381
|
|
|
380
382
|
setupProgressTracking(currentAudio, channelNumber, audioChannels);
|
package/src/volume.ts
CHANGED
|
@@ -699,8 +699,8 @@ export const initializeWebAudioForAudio = async (
|
|
|
699
699
|
const nodes = createWebAudioNodes(audio, channel.webAudioContext);
|
|
700
700
|
if (nodes) {
|
|
701
701
|
channel.webAudioNodes.set(audio, nodes);
|
|
702
|
-
// Set initial volume to match channel volume
|
|
703
|
-
nodes.gainNode.gain.value = channel.volume;
|
|
702
|
+
// Set initial volume to match channel volume with global volume multiplier
|
|
703
|
+
nodes.gainNode.gain.value = channel.volume * globalVolume;
|
|
704
704
|
}
|
|
705
705
|
}
|
|
706
706
|
};
|