W
wuchmin
Unregistered / Unconfirmed
GUEST, unregistred user!
用TACMWaveOut,TACMWaveIn开发语音聊天功能出现的问题.急!请大侠们顶力相助了,拜托了!问题若能解决,再送100分也可。
当对方说话,我这边接收声音时,出现:"WaveOutPrepareHeader error"错误提示后,点错误提示对话框的确定按钮,会出现"WaveOutWrite error"这样的提示 ,不知什么原因引起的,由于我用的是socket,而不是udp(demo中用的是udp).下面是相关的程序代码:
接收过程:
procedure TfrmMain.ClientSocketRead(Sender: TObject;
Socket: TCustomWinSocket);
var
SoundBufointer;
formatointer;
begin
GetMem(SoundBuf,ClientSocket.Socket.ReceiveLength);
ClientSocket.Socket.ReceiveBuf(SoundBuf^,ClientSocket.Socket.ReceiveLength);
ACMWaveOut1.PlayBack(SoundBuf,ClientSocket.Socket.ReceiveLength);
end;
//发送过程
procedure TfrmMain.ACMWaveIn1Data(data: Pointer;
size: Integer);
begin
ClientSocket.Socket.SendBuf(data,size);
end;
当对方说话,我这边接收声音时,出现:"WaveOutPrepareHeader error"错误提示后,点错误提示对话框的确定按钮,会出现"WaveOutWrite error"这样的提示 ,不知什么原因引起的,由于我用的是socket,而不是udp(demo中用的是udp).下面是相关的程序代码:
接收过程:
procedure TfrmMain.ClientSocketRead(Sender: TObject;
Socket: TCustomWinSocket);
var
SoundBufointer;
formatointer;
begin
GetMem(SoundBuf,ClientSocket.Socket.ReceiveLength);
ClientSocket.Socket.ReceiveBuf(SoundBuf^,ClientSocket.Socket.ReceiveLength);
ACMWaveOut1.PlayBack(SoundBuf,ClientSocket.Socket.ReceiveLength);
end;
//发送过程
procedure TfrmMain.ACMWaveIn1Data(data: Pointer;
size: Integer);
begin
ClientSocket.Socket.SendBuf(data,size);
end;