sandrohanea / whisper.net

Whisper.net. Speech to text made simple using Whisper Models
MIT License
534 stars 82 forks source link

Only 16KHz sample rate is supported. #55

Closed LoserFeng closed 1 year ago

LoserFeng commented 1 year ago

Whisper.net.Wave.NotSupportedWaveException HResult=0x80131500 Message=Only 16KHz sample rate is supported.

How To solve this problem

sandrohanea commented 1 year ago

Hello @LoserFeng , Currently in order to convert any wave file to the supported wave format, I recommend using either NAudio or FFmpeg (depending what type is your input file). We don't want to add this as a dependency to the base package, but some example will be added for this.

sandrohanea commented 1 year ago

Added example on how to use NAudio (another open-source library) to resample a wave file: https://github.com/sandrohanea/whisper.net/blob/main/examples/NAudioResampleWav/Program.cs