Delphi接入科大讯飞语音合成SDK

一、下载科大讯飞Win版本SDK

二、将SDK中的bin目录下的资源文件拷贝值新建工程目录,并建立dll引入单元,将c++dll头文件转成delphi

unit UnitXF;

interface

const
  HDANET_DLL = 'msc.dll';

type
  wave_pcm_hdr = record
    riff: array [0 .. 3] of AnsiChar; // = "RIFF"
    size_8: Integer; // = FileSize - 8
    wave: array [0 .. 3] of AnsiChar; // = "WAVE"
    fmt: array [0 .. 3] of AnsiChar; // 1     // = "fmt "
    fmt_size: Integer; // = 下一个结构体的大小 : 16
    format_tag: SmallInt; // = PCM : 1
    channels: SmallInt; // = 通道数 : 1
    samples_per_sec: Integer; // = 采样率 : 8000 | 6000 | 11025 | 16000
    avg_bytes_per_sec: Integer;
    // = 每秒字节数 : samples_per_sec * bits_per_sample / 8
    block_align: SmallInt; // = 每采样点字节数 : wBitsPerSample / 8
    bits_per_sample: SmallInt; // = 量化比特数: 8 | 16
    data: array [0 .. 3] of AnsiChar; // = "data";
    data_size: Integer; // = 纯数据长度 : FileSize - 44
  end;

  tts_result_ntf_handler = procedure(const sessionID: PAnsiChar;
    audio: PAnsiChar; audioLen: Integer

你可能感兴趣的:(delphi)