demo.py 447 B

123456789101112
  1. #!/usr/bin/env python3
  2. # -*- encoding: utf-8 -*-
  3. # Copyright FunASR (https://github.com/alibaba-damo-academy/FunASR). All Rights Reserved.
  4. # MIT License (https://opensource.org/licenses/MIT)
  5. from funasr import AutoModel
  6. model = AutoModel(model="damo/emotion2vec_base", model_revision="v2.0.1")
  7. wav_file = f"{model.model_path}/example/example/test.wav"
  8. res = model.generate(wav_file, output_dir="./outputs", granularity="utterance")
  9. print(res)