Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
whp98 committed Aug 5, 2024
1 parent 6d6e609 commit be07f5e
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
30 changes: 30 additions & 0 deletions docs/python相关/python语音识别fast-whisper.md
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')
```
11 changes: 11 additions & 0 deletions docs/兴趣/ffmpeg声音标准化处理.md
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
```

0 comments on commit be07f5e

Please sign in to comment.