@luna-editor/engine 0.5.15 → 0.5.16
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/Player.js +2 -0
- package/dist/hooks/useVoice.js +7 -2
- package/package.json +1 -1
package/dist/Player.js
CHANGED
|
@@ -551,9 +551,11 @@ export const Player = ({ scenario: scenarioProp, settings, plugins = EMPTY_PLUGI
|
|
|
551
551
|
var _a;
|
|
552
552
|
// パートボイス再生(テキスト表示と同時)
|
|
553
553
|
if (isContinuableBlock && ((_a = currentBlock.partVoice) === null || _a === void 0 ? void 0 : _a.url)) {
|
|
554
|
+
console.log("[PartVoice] Playing:", currentBlock.partVoice.name, currentBlock.partVoice.url);
|
|
554
555
|
playVoice(currentBlock.partVoice.url);
|
|
555
556
|
}
|
|
556
557
|
else if (isContinuableBlock) {
|
|
558
|
+
console.log("[PartVoice] No voice for block:", currentBlock.id, "partVoiceId:", currentBlock.partVoiceId, "partVoice:", currentBlock.partVoice);
|
|
557
559
|
stopVoice();
|
|
558
560
|
}
|
|
559
561
|
if (continueMode && isContinuableBlock) {
|
package/dist/hooks/useVoice.js
CHANGED
|
@@ -5,14 +5,19 @@ export const useVoice = () => {
|
|
|
5
5
|
const audioSettings = useAudioSettings();
|
|
6
6
|
const playVoice = useCallback((voiceUrl) => {
|
|
7
7
|
// ミュート中は再生しない
|
|
8
|
-
if (audioSettings.muteAudio)
|
|
8
|
+
if (audioSettings.muteAudio) {
|
|
9
|
+
console.log("[useVoice] Skipped: audio is muted");
|
|
9
10
|
return;
|
|
11
|
+
}
|
|
10
12
|
if (!audioRef.current) {
|
|
11
13
|
audioRef.current = new Audio();
|
|
12
14
|
}
|
|
13
15
|
audioRef.current.src = voiceUrl;
|
|
14
16
|
audioRef.current.volume = audioSettings.voiceVolume;
|
|
15
|
-
|
|
17
|
+
console.log("[useVoice] Playing:", voiceUrl, "volume:", audioSettings.voiceVolume);
|
|
18
|
+
audioRef.current.play().catch((err) => {
|
|
19
|
+
console.error("[useVoice] Play failed:", err);
|
|
20
|
+
});
|
|
16
21
|
}, [audioSettings.voiceVolume, audioSettings.muteAudio]);
|
|
17
22
|
const stopVoice = useCallback(() => {
|
|
18
23
|
if (audioRef.current) {
|