Windows 양식의 버튼을 클릭하면 오디오 파일 (또는 Skype 용 현재 입력 장치에 직접 오디오)을 보내려고합니다. 링크를 찾았지만 모든 참조가 깨진 것 같아서 어떻게 작동하는지 미칠 것입니다.Skype 통화로 오디오 보내기
이미 skype api에 연결하여 사용하고 있습니다. 이미 다른 프로젝트에서 사용 중이며 잘 작동합니다.하지만 입력 오디오 스트림에 오디오를 보낼 수 없습니다.
모든 의견을 환영합니다.
현재 코드 :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Speech;
using System.Speech.Synthesis;
using SKYPE4COMLib;
using System.Reflection;
using System.IO;
namespace TestSendAudioOnSkype
{
/// <summary>
/// Logica di interazione per MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
private Call CurrentCall = null;
private Skype SkypeApplet;
private const int SkypeProtocol = 9;
private SpeechSynthesizer Speak = new SpeechSynthesizer();
public MainWindow()
{
InitializeComponent();
try
{
SkypeApplet = new Skype();
SkypeApplet.Attach(SkypeProtocol, true);
SkypeApplet.CallStatus += SkypeApplet_CallStatus;
//CurrentCall = SkypeApplet.ActiveCalls[0];
}
catch (Exception e)
{
MessageBox.Show("errore: " + e.ToString());
System.Windows.Application.Current.Shutdown();
}
}
void SkypeApplet_CallStatus(Call pCall, TCallStatus Status)
{
if (Status == TCallStatus.clsInProgress)
CurrentCall = pCall;
}
private void button1_Click(object sender, RoutedEventArgs e)
{
if (CurrentCall == null)
{
CurrentCall = SkypeApplet.ActiveCalls[1];
}
string path = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string filepath = System.IO.Path.Combine(path,"tmp.wav");
Speak.SetOutputToWaveFile(filepath);
Speak.Speak("Hello world");
Speak.SetOutputToDefaultAudioDevice();
//Speak.SpeakAsync("Hello world");
try
{
CurrentCall.set_OutputDevice(TCallIoDeviceType.callIoDeviceTypeFile, filepath);
CurrentCall.set_InputDevice(TCallIoDeviceType.callIoDeviceTypeFile, filepath);
System.Threading.Thread.Sleep(3000);
CurrentCall.set_InputDevice(TCallIoDeviceType.callIoDeviceTypeFile, "");
CurrentCall.set_OutputDevice(TCallIoDeviceType.callIoDeviceTypeFile, "");
MessageBox.Show("invio terminato");
}
catch (Exception exc)
{
MessageBox.Show("errore: " + exc.ToString());
//System.Windows.Application.Current.Shutdown();
}
}
}
}
지금까지 발견했습니다 무엇 : 문제가 작동해야 내 코드를 직접적으로는 파일 형식에 대한처럼 http://community.skype.com/t5/Desktop-API-former-Public-API/Sending-Audio-in-Skype/td-p/422