函数说明上说如果文件名不指定则创建新文件录音,可就是没有指定路徑保存!郁闷死了!
在delphi_record中是这样实现的
procedure TForm1.playmsg(channelno: integer);
var
i,code:integer;
begin
case channel[channelno].step of
0: begin
startplayfile(channelno,'voc\welcome.pcm',0);
showgrid.Cells[2,channelno+1]:='摘机';
showgrid.Cells[3,channelno+1]:='欢迎致电东进公司…………';
channel[channelno].step:=1;
end;
1:begin
if checkplayend(channelno) then
begin
stopplayfile(channelno);
startrecordfile(channelno,pchar(inttostr(channelno)+'.pcm'),8000*60);//预设置录音长度为1分钟
initdtmfbuf(channelno);
channel[channelno].step:=2;
showgrid.Cells[3,channelno+1]:='开始录音';
end
end;
2:begin
code:=getdtmfcode(channelno);
if code=12 then
begin
stoprecordfile(channelno);
startplayfile(channelno,'voc\end1.pcm',0);
showgrid.Cells[3,channelno+1]:='重播留言';
channel[channelno].step:=3;
exit;
end;
if checkrecordend(channelno) then
begin
stoprecordfile(channelno);
showgrid.Cells[3,channelno+1]:='重播留言';
startplayfile(channelno,'voc\end2.pcm',0);
channel[channelno].step:=3;
end ;
end;
3:begin
if checkplayend(channelno) then
begin
cutpcm(trim(inttostr(channelno)+'.pcm'),3000); //直接去掉末尾3000左右的声音,把最后按键声音去掉
startplayfile(channelno,pchar(inttostr(channelno)+'.pcm'),0);
channel[channelno].step:=4;
end
end;
4:begin
if checkplayend(channelno) then
begin
startplayfile(channelno,'voc\byebye.pcm',0);
channel[channelno].step:=5;
end
end;
5:begin
if checkplayend(channelno) then
begin
resetchannel(channelno);
end
end;
end;
end;
在C#中要怎么办呢?