-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# python语音识别fast-whisper | ||
|
||
|
||
## 语音识别模型下载 | ||
|
||
```shell | ||
git clone https://huggingface.co/Systran/faster-whisper-large-v3 | ||
``` | ||
|
||
|
||
## 相关使用代码如下 | ||
|
||
|
||
```python | ||
from faster_whisper import WhisperModel | ||
|
||
def wisper_generate(audio_path): | ||
path = "./faster-whisper-medium" | ||
model = WhisperModel(model_size_or_path=path, device="auto", compute_type="int8", | ||
cpu_threads=12) | ||
segments, info = model.transcribe(audio=audio_path, | ||
vad_filter=True, | ||
vad_parameters=dict(min_silence_duration_ms=1000)) | ||
print("Detected language '%s' with probability %f" % (info.language, info.language_probability)) | ||
return segments,info | ||
if __name__ == "__main__": | ||
wisper_generate('./test-cn.mp3') | ||
wisper_generate('./test-en.mp3') | ||
wisper_generate('./test-ja.wav') | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# ffmpeg-normalize 声音标准化处理 | ||
|
||
|
||
## 安装ffmpeg-normalize | ||
```shell | ||
pip3 install ffmpeg-normalize | ||
``` | ||
## 使用ffmpeg-normalize标准化声音到-14LUFS | ||
```shell | ||
ffmpeg-normalize ./output_temp.mp3 -o ./output.mp3 -ar 44100 --target -14 --loudness-range 50 --dual-mono -c:a libmp3lame -b:a 192k -pr --dynamic -f | ||
``` |