日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

[Python] Matchering2.0自动匹配式母带最全应用

發布時間:2024/5/14 45 豆豆
生活随笔 收集整理的這篇文章主要介紹了 [Python] Matchering2.0自动匹配式母带最全应用 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

[Python] Matchering2.0自動匹配式母帶最全應用

前言
Matchering 是一個新穎化的web程序和python庫,用于音頻匹配和母帶處理。它遵循了一個非常簡單的想法,獲取兩個音頻文件并將其輸入到Matchering中:
target:需要制作母帶的目標音軌
reference:進行參考的參考音軌
Matchering會幫你自動分析并生成一個和參考文件相似的result文件。

如果還不知道matchering是什么的,可以看我的第一篇文章:
https://blog.csdn.net/m0_56699208/article/details/122721723?spm=1001.2014.3001.5502

Advanced Results:
代碼來自matchering官網的sample檔案:
https://github.com/sergree/matchering/blob/master/examples/advanced_results.py

import matchering as mg# Let's keep info and warning outputs here, muting out the debug ones mg.log(info_handler=print, warning_handler=print)mg.process(target="my_song.wav",reference="some_popular_song.wav",# pcm16 and pcm24 are just basic shortcuts# You can also use the Result class to make some advanced resultsresults=[# Basic WAV 16-bit, match + master`mg.pcm16("my_song_master_16bit.wav")`,# FLAC 24-bit, match only (no limiter), normalized to -0.01 dB# Recommendations for adjusting the amplitude will be displayed in the debug print if it is enabledmg.Result("custom_result_24bit_no_limiter.flac", subtype="PCM_24", use_limiter=False),# AIFF 32-bit float, match only (no limiter), non-normalized# Can exceed 0 dB without clipping# So you can directly feed it to some VST limiter in your DAWmg.Result("custom_result_32bit_no_limiter_non-normalized.aiff",subtype="FLOAT",use_limiter=False,normalize=False,)# More available formats and subtypes:# https://pysoundfile.readthedocs.io/en/latest/#soundfile.available_formats# https://pysoundfile.readthedocs.io/en/latest/#soundfile.available_subtypes], )

作者給出了三種導出文件的母帶文件的方式:
1.16-bit wav
最基本的16-bit wav文件,匹配加母帶

mg.pcm16("my_song_master_16bit.wav")

2.24-bit flac
24-bit flac文件,只匹配不加limiter,將電平控制在0.01db

mg.Result("custom_result_24bit_no_limiter.flac", subtype="PCM_24", use_limiter=False),

3.32-bit aiff
32-bit aiff文件,只匹配不加limiter,電平到0db但不產生clipping

mg.Result("custom_result_32bit_no_limiter_non-normalized.aiff",subtype="FLOAT",use_limiter=False,normalize=False,)

更多的導出格式可以參考:
https://pysoundfile.readthedocs.io/en/latest/#soundfile.available_formats
https://pysoundfile.readthedocs.io/en/latest/#soundfile.available_subtypes

大家可以根據這個示例導出自己需要的文件類型和音質,并能選擇是否自動添加limiter。可以說是非常方便了

另外,matchering還提供了預覽功能:
https://github.com/sergree/matchering/blob/master/examples/with_preview.py

import matchering as mg# Let's keep only warning outputs here, muting everything else mg.log(warning_handler=print)mg.process(target="my_song.wav",reference="some_popular_song.wav",results=[mg.pcm16("my_song_master_16bit.wav"),mg.pcm24("my_song_master_24bit.wav"),],# These two lines will allow you to create two 30-second FLAC files with the loudest parts of:# 'my_song.wav' and 'my_song_master_16bit.wav'# Use them to quickly compare the target audio with the resulting audiopreview_target=mg.pcm16("preview_my_song.flac"),preview_result=mg.pcm16("preview_my_song_master.flac"), )

使用preview_targetpreview_result可以生成兩個在最大響度處30s的flac文件供使用者試聽,以便使用者最快速知道母帶之后的版本是否和自己心意。

preview_target=mg.pcm16("preview_my_song.flac"),preview_result=mg.pcm16("preview_my_song_master.flac"),

總結

以上是生活随笔為你收集整理的[Python] Matchering2.0自动匹配式母带最全应用的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。