Skip to content

Python マスタリング API ​

libsonare Python パッケージのマスタリングの関数群です。チェーン、プロセッサ、プリセット、リファレンストラックを使う処理に加え、ソースを解析してチェーンを提案するアシスタントも扱います。ほかの関数群は Python API の目次ページにあります。ミキシングは Python Mixer クラス API、単発のダイナミクスとリペアは Python ダイナミクスとリペア API、ストリーミングとブロック単位のプロセッサは Python ストリーミング API にあります。

マスタリング API ​

Python からもブラウザデモと同じ名前付きマスタリングプロセッサを利用できます。まず一覧取得用のヘルパー関数で、現在のビルドに含まれるプロセッサ名を確認したうえで、モノラル/ステレオ/ペア/解析の各 API をパラメータ明示で呼び出します。ファイル 1 本をラウドネス目標にそろえるだけなら、Python で音声を -14 LUFS にノーマライズする のスクリプトで足ります。フルチェーンは各ステージを下の固定順で実行します。

マスタリングチェーンの順序
リペアEQダイナミクスサチュレーションスペクトルステレオマキシマイザーラウドネス
有効化したステージだけが処理されますが、有効なステージは常にこの順で実行されます。

目的から入口を選ぶには、次の表を使います。

目的関数
シンプルなラウドネスマスタリングmastering()
組み込みプリセット一覧mastering_preset_names()
組み込みプリセットのフラットなチェーンパラメータを取得mastering_preset_params()
チェーン設定の JSON ドキュメントを検証してパラメータを取得mastering_chain_config_from_json()
プリセットをモノラルに適用master_audio()
プリセットをステレオに適用master_audio_stereo()
ブロック単位のストリーミングStreamingMasteringChain
マスタリング判断用の音源プロファイルを取得mastering_audio_profile()
ステレオ両チャンネルから音源プロファイルを取得mastering_audio_profile_stereo()
音源解析からマスタリングの提案を取得mastering_assistant_suggest()
ステレオ両チャンネルからマスタリングの提案を取得mastering_assistant_suggest_stereo()
配信先ごとのラウドネス見込みをプレビューmastering_streaming_preview()
ステレオ両チャンネルから配信先ごとのラウドネス見込みをプレビューmastering_streaming_preview_stereo()
組み込みの配信先一覧mastering_platform_names()
名前付きプロセッサ一覧(モノラル/ステレオ)mastering_processor_names()
プロセッサ分類カタログを取得mastering_processor_catalog()
ギターアンプのプリセットとそのパラメータ一覧mastering_amp_preset_catalog()
チェーンのインサートプロセッサ一覧mastering_insert_names()
インサートが受け付けるパラメータキー一覧mastering_insert_param_names()
インサートの構築キーとオートメーション対象の記述子mastering_insert_param_info()
構成したインサートのレイテンシとテールを取得mastering_insert_timing()
モノラルプロセッサを単体で実行mastering_apply_processor()
ステレオプロセッサを単体で実行mastering_apply_processor_stereo()
ペアプロセッサ一覧mastering_pair_processor_names()
ソース/リファレンスのペア処理mastering_apply_pair_processor()
ステレオのソース/リファレンスのペア処理mastering_apply_pair_processor_stereo()
ペア解析の一覧mastering_pair_analysis_names()
ソース/リファレンスのペア解析mastering_analyze_pair()
ソースのラウドネスをリファレンスへ合わせるmastering_ab_match_loudness()
ステレオソースのラウドネスをステレオリファレンスへ合わせるmastering_ab_match_loudness_stereo()
ステレオ解析の一覧mastering_stereo_analysis_names()
ステレオチャンネル解析mastering_analyze_stereo()

関連するマスタリングガイド: プリセット選択、配信ターゲット、メーターの読み方、品質チェックリスト。

単体プロセッサの実行 ​

python
import libsonare as sonare

print(sonare.mastering_processor_names())
# 例: ['dynamics.brickwallLimiter', 'dynamics.compressor', 'dynamics.deesser', 'dynamics.expander', ...]

result = sonare.mastering_apply_processor(
    "spectral.airBand",
    samples,
    sample_rate,
    params={
        "amount": 0.4,
        "shelfFrequencyHz": 14000,
    },
)

report = sonare.mastering_analyze_stereo(
    "stereo.monoCompatCheck",
    left,
    right,
    sample_rate,
)
print(report.correlation, report.likely_mono_compatible)

catalog = sonare.mastering_processor_catalog()
insert_params = sonare.mastering_insert_param_info("eq.parametric")
python
# Return supported mastering processor names shared by CLI/Node/WASM/Python.
def mastering_processor_names() -> list[str]: ...

# Return the full catalog of mastering processors.
def mastering_processor_catalog() -> list[MasteringProcessorCatalogEntry]: ...

# Return the built-in amp-sim rig catalog.
def mastering_amp_preset_catalog() -> list[MasteringAmpPresetCatalogEntry]: ...

# Return the mastering insert (FX) names shared by CLI/Node/WASM/Python.
def mastering_insert_names() -> list[str]: ...

# Return the camelCase parameter names a given insert/FX processor reads.
def mastering_insert_param_names(insert: str) -> list[str]: ...

# Return parameter metadata for a given insert/FX processor.
def mastering_insert_param_info(
    insert: str,
    sample_rate: int | None = None,
) -> list[MasteringInsertParamInfo]: ...

# Return the latency and tail of one insert built from ``params`` at ``sample_rate``.
def mastering_insert_timing(
    insert: str,
    params: Mapping[str, float | bool | str | Sequence[float]] | None = None,
    sample_rate: int | None = None,
) -> MasteringInsertTiming: ...

# Apply a named mastering processor using the shared cross-language API.
def mastering_apply_processor(
    processor: str,
    samples: Sequence[float] | list[float],
    sample_rate: int,
    params: dict[str, float | int | bool | str] | None = None,
) -> MasteringResult: ...

# Apply a named stereo mastering processor using the shared cross-language API.
def mastering_apply_processor_stereo(
    processor: str,
    left: Sequence[float] | list[float],
    right: Sequence[float] | list[float],
    sample_rate: int,
    params: dict[str, float | int | bool | str] | None = None,
) -> MasteringStereoResult: ...

# Return supported stereo mastering analysis names.
def mastering_stereo_analysis_names() -> list[str]: ...

# Run a named stereo mastering analysis and return its record.
def mastering_analyze_stereo(
    analysis: str,
    left: Sequence[float] | list[float],
    right: Sequence[float] | list[float],
    sample_rate: int,
    params: dict[str, float | int | bool] | None = None,
) -> StereoMonoCompatCheckResult | StereoMonoCompatCheckLogBandsResult: ...

プリセットとフルチェーン ​

python
# プリセット式のチェーン(一括処理)
sonare.mastering_preset_names()
# -> ['pop', 'edm', 'acoustic', 'hipHop', 'aiMusic', 'speech', 'streaming', 'youtube', 'broadcast', 'podcast', 'audiobook', 'cinema', 'jpop', 'ambient', 'lofi', 'classical', 'drumAndBass', 'techno', 'metal', 'trap', 'rnb', 'jazz', 'kpop', 'trance', 'gameOst', 'vinyl', 'tapeHiss', 'fieldRecording', 'voiceMemo', 'shellac78']
preset_params = sonare.mastering_preset_params("aiMusic")
chain_result = sonare.master_audio(
    samples,
    sample_rate,
    preset="aiMusic",
    overrides={
        "loudness.targetLufs": -13,
        "maximizer.truePeakLimiter.releaseMs": 50,
        "maximizer.truePeakLimiter.applyGainAtInputRate": False,
    },
)
print(chain_result.output_lufs, chain_result.output_true_peak_dbtp, chain_result.output_loudness_range_lu)
print(chain_result.stage_gain_reductions)
if chain_result.report is not None:
    print(chain_result.report.before, chain_result.report.after)
    print(chain_result.report.band_energy_delta_db)

mastering_chain_config_from_json() は、チェーン設定の JSON ドキュメントをネイティブ CLI の --chain-config と同じ読み方で検証します(バージョン 2。version は省略できます)。チェーンの全パラメータを、ドキュメントの値または既定値で埋めた形で返します。形は mastering_preset_params() の戻り値と同じで、そのまま master_audio() の overrides に渡せます。

python
# Apply mastering loudness normalization with a true-peak ceiling.
def mastering(
    samples: Sequence[float] | list[float],
    sample_rate: int,
    target_lufs: float = -14.0,
    ceiling_dbtp: float = -1.0,
    true_peak_oversample: int | None = None,
    release_ms: float | None = None,
    apply_gain_at_input_rate: bool = False,
) -> MasteringResult: ...

# Return built-in mastering preset identifiers (e.g.
def mastering_preset_names() -> list[str]: ...

# Return a built-in preset's chain configuration document's params.
def mastering_preset_params(preset: str) -> MasteringChainConfig: ...

# Validate a chain configuration document and return its params.
def mastering_chain_config_from_json(document: str) -> MasteringChainConfig: ...

# Master mono audio with a named preset, a chain of overrides, or both.
def master_audio(
    samples: Sequence[float] | list[float],
    sample_rate: int,
    *,
    preset: str | None = None,
    overrides: MasteringChainConfigInput | None = None,
    on_progress: Callable[[float, str], None] | None = None,
    cancel: Callable[[], bool] | None = None,
) -> MasteringChainResult: ...

# Master stereo audio with a named preset, a chain of overrides, or both.
def master_audio_stereo(
    left: Sequence[float] | list[float],
    right: Sequence[float] | list[float],
    sample_rate: int,
    *,
    preset: str | None = None,
    overrides: MasteringChainConfigInput | None = None,
    on_progress: Callable[[float, str], None] | None = None,
    cancel: Callable[[], bool] | None = None,
) -> MasteringChainStereoResult: ...

ストリーミングチェーン ​

python
# ブロック単位のストリーミング処理
with sonare.StreamingMasteringChain(
    {
        "eq.tilt.tiltDb": 0.5,
        "dynamics.compressor.thresholdDb": -20.0,
    },
    sample_rate=48000,
    num_channels=1,
    max_block_size=512,
) as chain:
    print(chain.stage_names(), chain.latency_samples)  # latency_samples はプロパティ
    output = [chain.process_mono([0.0] * 512)]
    tail = chain.flush_mono()
    while tail.size:
        output.append(tail)
        tail = chain.flush_mono()

chain.set_parameter(key, value) を呼ぶと、ストリーミングで安全なパラメータをブロック境界で 1 つ変更できます。この呼び出しは処理、フラッシュ、リセットと直列化されます。未知のキー、構造を変えるキー、無効化したステージのキーは変更前に拒否されるため、失敗してもチェーンと音声履歴は変わりません。パラメータ変更に自動スムージングはありません。

ストリーミング入力の最終ブロック後は、空の配列が返るまで flush_mono() を呼び、ステレオでは両チャンネルが空になるまで flush_stereo() を呼びます。

python
# Block-by-block streaming variant of :func:`master_audio`.
class StreamingMasteringChain:
    # Build and prepare a streaming mastering chain.
    def __init__(
        self,
        config: MasteringChainConfigInput | None = None,
        *,
        sample_rate: int,
        num_channels: int,
        max_block_size: int | None = None,
        loudness_static_gain_db: float | None = None,
        loudness_static_gain_peak_dbtp: float | None = None,
    ) -> None: ...
    # Process one mono block, returning the processed samples (length unchanged).
    def process_mono(self, samples: Sequence[float] | np.ndarray) -> np.ndarray: ...
    # Process one stereo block, returning the processed (left, right) channels.
    def process_stereo(
        self,
        left: Sequence[float] | np.ndarray,
        right: Sequence[float] | np.ndarray,
    ) -> StereoBlock: ...
    # Emit delayed audio and finite processor tails after the final mono block.
    def flush_mono(self) -> np.ndarray: ...
    # Stereo counterpart of :meth:`flush_mono`.
    def flush_stereo(self) -> StereoBlock: ...
    # Reset all processor state without rebuilding.
    def reset(self) -> None: ...
    # Update one realtime-safe full-chain parameter between processing calls.
    def set_parameter(self, key: str, value: float) -> None: ...
    # The largest block :meth:`process_mono` / :meth:`process_stereo` accept.
    @property
    def max_block_size(self) -> int: ...
    # Total reported latency in samples across all active processors.
    @property
    def latency_samples(self) -> int: ...
    # Non-finite samples this chain's stages replaced.
    @property
    def non_finite_substitution_count(self) -> int: ...
    # Process/flush calls in which a stage discarded its state.
    @property
    def non_finite_discard_count(self) -> int: ...
    # Return the realized stage names in processing order.
    def stage_names(self) -> list[str]: ...
    # Release the underlying C handle.
    def close(self) -> None: ...
    # Return the object itself for ``with`` use.
    def __enter__(self) -> StreamingMasteringChain: ...
    # Close the object on leaving the ``with`` block; never suppresses exceptions.
    def __exit__(self, exc_type: object, exc: object, tb: object) -> None: ...

リファレンストラックを使う処理 ​

リファレンストラックを使う処理では mastering_pair_processor_names()、mastering_apply_pair_processor()、mastering_apply_pair_processor_stereo()、mastering_pair_analysis_names()、mastering_analyze_pair() を使います。モノラルの mastering_apply_pair_processor() は MasteringResult を返し、ソースとリファレンスの長さが異なっていても処理できます。ステレオ版は source_left、source_right、reference_left、reference_right を受け取り、left、right、sample_rate、input_lufs、output_lufs、applied_gain_db、latency_samples、loudness_target_limited、non_finite_substitution_count を持つ MasteringStereoResult を返します。各ソースペアと各リファレンスペアは左右の長さを揃える必要がありますが、ソースペアとリファレンスペアの長さは異なって構いません。ステレオの match.abCrossfade は短い方のペア長を使います。ペアプロセッサ、ペア解析、A/B マッチはいずれも reference_sample_rate(既定は sample_rate)を受け取ります。別のレートのリファレンスはソースのレートへリサンプルされ、遅延推定はソースのレートのサンプル数で返ります。

ラウドネスを揃えた A/B 比較には、mastering_ab_match_loudness() を使うと LoudnessMatchResult(samples、sample_rate、reference_lufs、source_lufs、applied_gain_db、matched_true_peak_dbtp)が返ります。mastering_ab_match_loudness_stereo() は、samples の代わりに left と right を持つ LoudnessMatchStereoResult を返します。ステレオの各ソース/リファレンスペアは左右の長さを揃えますが、ソースとリファレンスの長さは異なって構いません。ステレオ版はソースの両チャンネルに 1 つのゲインを共有して適用し、シーリングは行いません。

python
# Return supported two-input mastering processor names.
def mastering_pair_processor_names() -> list[str]: ...

# Apply a named two-input mastering processor.
def mastering_apply_pair_processor(
    processor: str,
    source: Sequence[float] | list[float],
    reference: Sequence[float] | list[float],
    sample_rate: int,
    params: dict[str, float | int | bool] | None = None,
    *,
    reference_sample_rate: int | None = None,
) -> MasteringResult: ...

# Apply the stereo ``match.abCrossfade`` pair processor.
def mastering_apply_pair_processor_stereo(
    processor: str,
    source_left: Sequence[float] | list[float],
    source_right: Sequence[float] | list[float],
    reference_left: Sequence[float] | list[float],
    reference_right: Sequence[float] | list[float],
    sample_rate: int,
    params: dict[str, float | int | bool] | None = None,
    *,
    reference_sample_rate: int | None = None,
) -> MasteringStereoResult: ...

# Return supported two-input mastering analysis names.
def mastering_pair_analysis_names() -> list[str]: ...

# Run a named two-input mastering analysis and return its record.
def mastering_analyze_pair(
    analysis: str,
    source: Sequence[float] | PlanarChannels,
    reference: Sequence[float] | PlanarChannels,
    sample_rate: int,
    params: dict[str, float | int | bool] | None = None,
    *,
    reference_sample_rate: int | None = None,
) -> MatchReferenceLoudnessResult | MatchTonalBalanceResult | MatchEqCurveResult | MatchEstimateReferenceDelaySamplesResult: ...

# Gain-match ``source`` to ``reference``'s integrated loudness.
def mastering_ab_match_loudness(
    source: Sequence[float] | list[float] | np.ndarray,
    reference: Sequence[float] | list[float] | np.ndarray,
    sample_rate: int,
    *,
    reference_sample_rate: int | None = None,
) -> LoudnessMatchResult: ...

# Gain-match a stereo source to a stereo reference with one shared gain.
def mastering_ab_match_loudness_stereo(
    source_left: Sequence[float] | list[float] | np.ndarray,
    source_right: Sequence[float] | list[float] | np.ndarray,
    reference_left: Sequence[float] | list[float] | np.ndarray,
    reference_right: Sequence[float] | list[float] | np.ndarray,
    sample_rate: int,
    *,
    reference_sample_rate: int | None = None,
) -> LoudnessMatchStereoResult: ...

進捗コールバック ​

master_audio() と master_audio_stereo() は、オプションの on_progress=callable キーワードを受け取ります。

このコールバックは、各ステージ完了時に (progress: float, stage: str) で呼び出されます。

値意味
progress0.0〜1.0 の全体進捗。
stage完了した名前付きプロセッサ。例: eq.tilt, dynamics.compressor, loudness.optimize。

UI の進捗バー表示や、ステージごとの所要時間ロギングに利用できます。

python
def on_step(progress: float, stage: str) -> None:
    print(f"{progress:5.1%}  {stage}")

result = sonare.master_audio(
    samples,
    sample_rate,
    overrides={"loudness.targetLufs": -14, "loudness.ceilingDbtp": -1},
    on_progress=on_step,
)

設定キーとインサート記述子 ​

設定 dict からは、任意バンド数のマルチバンドコンプレッサーも扱えます。dynamics.multibandComp は crossover(cutoffsHz、slope、mode、firKernelSize)と bands(バンドごとの dict)を受け付けます。overrides ではフラットキーの dynamics.multibandComp.crossover.cutoffsHz.<i>、スカラーのカットオフキー群 dynamics.multibandComp.cutoff{i}Hz、dynamics.multibandComp.bands.<i>.<field> も使えます。バンド数は 2 から 64 で、cutoffsHz はカットオフ一覧を置き換えて、バンド数を要素数 + 1 に決めます。列挙型のキーは数値と並んで choices の名前でも指定できます("repair.denoise.noiseEstimator": "spp"、dynamics.compressor.detector、マルチバンドのスロープ・モード・ディテクターのキー)。mastering_apply_processor、mastering_apply_processor_stereo、mastering_insert_timing の params も同じ名前を受け付けます。repair.denoise.enabled を有効にしたストリーミングチェーンは、ノイズ推定器の既定が spp で、quantile は名前を示して拒否されます。

mastering_insert_param_names(insert) は mastering_insert_names() が返す ID の構築用キーを列挙します。mastering_insert_param_info(insert, sample_rate=...) はオフラインのリペアステージを含むプロセッサカタログの ID に対する記述子を返し、型、範囲、既定値、選択肢、条件付きの slot、範囲を動かす兄弟キーを示す depends_on / coupled_with を確認できます。sample_rate を渡すと、ナイキスト周波数で決まる上限がそのレートで解決されます。それぞれの関数は対象集合にない ID に SonareValueError を送出します。mastering_insert_timing() はそのパラメータでインサートを構築し、latency_samples と tail_samples を返します。インサートが読まないキーは拒否されます。params は記述子が宣言するあらゆる値の型(数値、真偽値、列挙名、文字列、数値のリスト)を受け付け、型の違う値は TypeError、有限でない数値は SonareValueError です。mastering_preset_params() はプリセットのフラットな上書きマップを返し、そのまま master_audio(..., overrides=...) に渡せます。

アシスタント・プロファイル・プレビュー ​

マスタリングのうち分析側の関数群です。オーディオプロファイル、アシスタントによるチェーン提案、ストリーミングプラットフォーム向けのプレビューがあり、それぞれステレオ用の入口を備えています。提案が使うチェーンは前の節に、アシスタントが推奨するリペアの各ステージは Python ダイナミクスとリペア API にあります。

python
profile = sonare.mastering_audio_profile(samples, sample_rate, params={
    "nFft": 2048,
    "hopLength": 512,
    "truePeakOversample": 4,
})
print(profile.loudness.integrated_lufs, profile.spectral.centroid_hz)
suggestion = sonare.mastering_assistant_suggest(samples, sample_rate, params={
    "targetLufs": -14,
    "ceilingDbtp": -1,
    "preferStreamingSafe": True,
})
print(suggestion.explanation, suggestion.chain_config)
preview = sonare.mastering_streaming_preview(samples, sample_rate, platforms=[
    {"name": "YouTube", "target_lufs": -14, "ceiling_dbtp": -1},
    {"name": "Podcast", "target_lufs": -16, "ceiling_dbtp": -1},
])
for platform in preview.platforms:
    print(platform.name, platform.normalization_gain_db, platform.ceiling_risk)

# ステレオ入口: パラメータも戻り値のレコードも同じで、測定だけが両チャンネル基準になります。
stereo_profile = sonare.mastering_audio_profile_stereo(left, right, sample_rate, params={
    "nFft": 2048,
    "hopLength": 512,
    "truePeakOversample": 4,
})
stereo_suggestion = sonare.mastering_assistant_suggest_stereo(left, right, sample_rate, params={
    "targetLufs": -14,
    "ceilingDbtp": -1,
    "preferStreamingSafe": True,
})
# platforms を省略すると、組み込みの Spotify / Apple Music / YouTube のセットが使われます。
stereo_preview = sonare.mastering_streaming_preview_stereo(left, right, sample_rate)
python
# Analyze audio and return the mastering assistant profile.
def mastering_audio_profile(
    samples: Sequence[float] | list[float],
    sample_rate: int,
    params: dict[str, float | int | bool] | None = None,
) -> MasteringAudioProfile: ...

# Return the mastering assistant profile of a stereo pair.
def mastering_audio_profile_stereo(
    left: Sequence[float] | list[float],
    right: Sequence[float] | list[float],
    sample_rate: int,
    params: dict[str, float | int | bool] | None = None,
) -> MasteringAudioProfile: ...

# Analyze audio and suggest a mastering chain with the reasoning behind it.
def mastering_assistant_suggest(
    samples: Sequence[float] | list[float],
    sample_rate: int,
    params: dict[str, float | int | bool | str] | None = None,
) -> MasteringAssistantResult: ...

# Suggest a mastering chain for a stereo pair.
def mastering_assistant_suggest_stereo(
    left: Sequence[float] | list[float],
    right: Sequence[float] | list[float],
    sample_rate: int,
    params: dict[str, float | int | bool | str] | None = None,
) -> MasteringAssistantResult: ...

# Preview streaming-platform normalization and ceiling risk.
def mastering_streaming_preview(
    samples: Sequence[float] | list[float],
    sample_rate: int,
    platforms: Sequence[StreamingPlatform] | None = None,
) -> MasteringStreamingPreviewResult: ...

# Preview streaming normalization for a stereo pair.
def mastering_streaming_preview_stereo(
    left: Sequence[float] | list[float],
    right: Sequence[float] | list[float],
    sample_rate: int,
    platforms: Sequence[StreamingPlatform] | None = None,
) -> MasteringStreamingPreviewResult: ...

# Return the delivery targets the mastering assistant accepts.
def mastering_platform_names() -> list[str]: ...

3 つのヘルパーにはそれぞれ _stereo 版があります。バッファ 1 本ではなく left と right を受け取り、params / platforms は同じもの、戻り値も同じレコード型です。2 チャンネルの素材を扱うときは常にこちらを使ってください。モノラル側の入口は 0.5 * (left + right) のダウンミックスを測定するため、相関の低いステレオ素材では約 6 dB 低く出ます。その分だけ、積分ラウドネス、そこから導かれる正規化ゲイン、ピーク余裕の判定がまとめて過小評価されます。

ステレオ版を使う理由

相関を落としたピンクノイズのペア(48 kHz・4 秒)では、ダウンミックス経由が -22.55 LUFS、ステレオ経由が -16.44 LUFS で、差は 6.11 dB でした。同じ差が Spotify の normalizationGainDb を +2.44 から +8.55 に押し上げます。相関の高いペアでは差は 3.01 dB にとどまり、これはダウンミックスで振幅が半分になる分です。残りの約 3 dB が相関の低さによるものです。

ステレオプロファイルのうち、両チャンネルから測るのは loudness ブロックだけです。積分 LUFS と LRA はチャンネルを合算したプログラムから求め、True Peak は 2 つのうち大きい方を採ります。スペクトル・ダイナミクス・テンポの各フィールドは絶対レベルではなく形と時間構造を表すため、ダウンミックス基準のまま据え置き、モノラル呼び出しの結果とそのまま比較できます。

オプションと結果フィールド ​

エントリポイント/結果キー備考
mastering_audio_profile(params=)nFft、hopLength、truePeakOversampleすべて任意です。
mastering_assistant_suggest(params=)targetLufs、ceilingDbtp、enableRepair、preferStreamingSafe、speechMonoAmount、preset、targetPlatformすべて任意です。キーは camelCase で、snake_case の綴りは名前を挙げて拒否されます。
mastering(...)release_ms、apply_gain_at_input_rateリミッターのリリースと静的ゲイン段の位置です。release_ms を省略するか None を渡すと 50 ms のライブラリ既定値になり、明示的な 0 や負の値は SonareValueError になります。プリセットやチェーンの上書きではフラットキーの "maximizer.truePeakLimiter.releaseMs" と "maximizer.truePeakLimiter.applyGainAtInputRate" を使い、渡した値がそのまま適用されます。
オフラインのチェーン/プリセット結果output_true_peak_dbtp、output_loudness_range_lu、stage_gain_reductionsTrue Peak は設定したラウドネス用オーバーサンプル倍率で測ります。output_loudness_range_lu は EBU R128 のラウドネスレンジ(LU)です。各リダクションには、ダイナミクスまたはマキシマイザーのステージ名と、その直近のゲインリダクション(0 以下の dB)が入ります。
result.reportbefore、after、band_energy_delta_dbbefore と after にはそれぞれ integrated_lufs、max_momentary_lufs、max_short_term_lufs、true_peak_dbtp、loudness_range_lu が入ります。band_energy_delta_db は処理前後の対数スペクトルエネルギー変化を示す 32 バンドの値です。レポートには適用ゲイン、最大ゲインリダクション、ピークの余裕によってラウドネス目標が制限されたかどうかも入ります。