mirror of
https://github.com/denizsafak/abogen.git
synced 2026-09-20 11:40:57 +02:00
fix: use existing to_float32 from audio_helpers, keep INFO log level
- synthesize.py: import to_float32 from domain.audio_helpers instead of duplicate - Revert all log levels back to INFO (user controls verbosity via --log-level)
This commit is contained in:
@@ -301,7 +301,7 @@ def execute_conversion(
|
|||||||
|
|
||||||
chapter_display = f"Chapter {chapter_idx}/{len(plan.chapters)}: {chapter.title}"
|
chapter_display = f"Chapter {chapter_idx}/{len(plan.chapters)}: {chapter.title}"
|
||||||
events.log(f"Processing {chapter_display}")
|
events.log(f"Processing {chapter_display}")
|
||||||
logging.info("[executor] Chapter %d/%d start: title=%s", chapter_idx, len(plan.chapters), chapter.title)
|
logging.info("[executor] Chapter %d/%d: %s", chapter_idx, len(plan.chapters), chapter.title)
|
||||||
|
|
||||||
# Resolve chapter voice
|
# Resolve chapter voice
|
||||||
chapter_provider, chapter_voice, chapter_speed, chapter_steps = _resolve_voice(
|
chapter_provider, chapter_voice, chapter_speed, chapter_steps = _resolve_voice(
|
||||||
@@ -532,7 +532,7 @@ def execute_conversion(
|
|||||||
collector.on_chapter_end(stats.current_time)
|
collector.on_chapter_end(stats.current_time)
|
||||||
logging.info("[executor] Chapter %d/%d done: time=%.1fs", chapter_idx, len(plan.chapters), stats.current_time)
|
logging.info("[executor] Chapter %d/%d done: time=%.1fs", chapter_idx, len(plan.chapters), stats.current_time)
|
||||||
|
|
||||||
logging.info("[executor] All chapters processed, total time=%.1fs", stats.current_time)
|
logging.info("[executor] All chapters done: total=%.1fs", stats.current_time)
|
||||||
|
|
||||||
# Process outro
|
# Process outro
|
||||||
if plan.outro and plan.outro.enabled and merge_chapters:
|
if plan.outro and plan.outro.enabled and merge_chapters:
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import soundfile as sf
|
|||||||
from flask import current_app, send_file
|
from flask import current_app, send_file
|
||||||
from flask.typing import ResponseReturnValue
|
from flask.typing import ResponseReturnValue
|
||||||
|
|
||||||
|
from abogen.domain.audio_helpers import to_float32
|
||||||
from abogen.domain.device import select_device as _select_device
|
from abogen.domain.device import select_device as _select_device
|
||||||
from abogen.domain.enums import Language
|
from abogen.domain.enums import Language
|
||||||
from abogen.domain.split_pattern import get_split_pattern
|
from abogen.domain.split_pattern import get_split_pattern
|
||||||
@@ -155,7 +156,7 @@ def generate_preview_audio(
|
|||||||
graphemes = getattr(segment, "graphemes", "").strip()
|
graphemes = getattr(segment, "graphemes", "").strip()
|
||||||
if not graphemes:
|
if not graphemes:
|
||||||
continue
|
continue
|
||||||
audio = _to_float32(getattr(segment, "audio", None))
|
audio = to_float32(getattr(segment, "audio", None))
|
||||||
if audio.size == 0:
|
if audio.size == 0:
|
||||||
continue
|
continue
|
||||||
remaining = max_samples - accumulated
|
remaining = max_samples - accumulated
|
||||||
|
|||||||
Reference in New Issue
Block a user