import { audioPath, config, sleep } from './common.ts';

import { Asr } from '../auc.ts';
import fs from 'fs';
import util from 'node:util';
const wavToBase64 = (filePath: string) => {
  const data = fs.readFileSync(filePath);
  return data.toString('base64');
};

const main = async () => {
  const base64Audio = wavToBase64(audioPath);
  const auc = new Asr({
    appid: config.VOLCENGINE_AUC_APPID,
    token: config.VOLCENGINE_AUC_TOKEN,
  });
  const result = await auc.getText({ audio: { data: base64Audio } });
  console.log(util.inspect(result, { showHidden: false, depth: null, colors: true }))
}

main();