1
votes

The audio file format must meet the following requirements.

  • Container WAV
  • Encoding PCM
  • Rate 16K
  • Sample Format 16 bit
  • Channels Mono.

How to achieve this from web page? Can't find any resources:(

1

1 Answers

0
votes

Use ffmpeg (See the FFmpeg wiki, or the man page with man ffmpeg)

This command will change any audio or video to

  • PCM 16bit (-acodec pcm_s16le)
  • 16K (-ar 16000)
  • Mono (-ac 1)

ffmpeg -i input.any -acodec pcm_s16le -ac 1 -ar 16000 output.wav

For web, there are multiple options here are 2

  1. github.com/muaz-khan/RecordRTC
  2. https://github.com/rposbo/speaker-recognition-api/blob/master/recorder.js