F
flysyd
Unregistered / Unconfirmed
GUEST, unregistred user!
今天,看视频&语音-1对1&1对多聊天程序 地址http://www.tomore.com/1/41773.html
视频传输没问题,可是对mic说话时音箱没一点声音,不知为什么,请大家帮忙了。D7下实现
代码如下:
procedure TForm1.UDPServerUDPRead(Sender: TObject;
AData: TStream;
ABinding: TIdSocketHandle);
var
Buf:Array[0..9] of byte;
jpg:TJpegImage;
memStream:TMemoryStream;
begin
AData.Read(Buf,Sizeof(Buf));
//显示网传来的图像,不知if条件何意
if (Buf[6]=$4A) and (Buf[7]=$46) and (Buf[8]=$49) and (Buf[9]=$46) then
begin
try
AData.Seek(0,0);
jpg := TJpegImage.Create;
jpg.LoadFromStream(Adata);
Image.Picture.Bitmap.Assign(jpg);
jpg.Free;
except
end;
Image.Refresh;
end
else
begin
memStream:=TMemoryStream.Create;
memStream.LoadFromStream(AData);
//通过acm播放声音,可是没任何反应
ACMOut.Play(memStream.Memory^,memStream.Size);
memStream.Free;
end;
end;
//ACMOut.Play(memStream.Memory^,memStream.Size);的原型
//procedure TACMOut.Play(var Buffer;
Size: Integer);
视频传输没问题,可是对mic说话时音箱没一点声音,不知为什么,请大家帮忙了。D7下实现
代码如下:
procedure TForm1.UDPServerUDPRead(Sender: TObject;
AData: TStream;
ABinding: TIdSocketHandle);
var
Buf:Array[0..9] of byte;
jpg:TJpegImage;
memStream:TMemoryStream;
begin
AData.Read(Buf,Sizeof(Buf));
//显示网传来的图像,不知if条件何意
if (Buf[6]=$4A) and (Buf[7]=$46) and (Buf[8]=$49) and (Buf[9]=$46) then
begin
try
AData.Seek(0,0);
jpg := TJpegImage.Create;
jpg.LoadFromStream(Adata);
Image.Picture.Bitmap.Assign(jpg);
jpg.Free;
except
end;
Image.Refresh;
end
else
begin
memStream:=TMemoryStream.Create;
memStream.LoadFromStream(AData);
//通过acm播放声音,可是没任何反应
ACMOut.Play(memStream.Memory^,memStream.Size);
memStream.Free;
end;
end;
//ACMOut.Play(memStream.Memory^,memStream.Size);的原型
//procedure TACMOut.Play(var Buffer;
Size: Integer);