Проблема с event'ами в Web Service
От: cheaterx  
Дата: 22.07.08 08:42
Оценка:
Пишу Web Service, который в итоге должен микшировать несколько wav-файлов в один mp3. Но проблемы появились уже на начальном этапе, дело в том что для микширования я использую сторонний компонент Audio Sound Editor (он отлично работает токо под Windows Application), я же хочу извратится и заюзать его под Веб-сервис (не уверен что это вообще возможно). Так вот, суть проблемы в том, что не обрабатываются события SoundLoadingStarted и SoundLoadingDone после вызова метода LoadSound, они просто игнорируются как будто бы их никто не объявлял

Выкладываю свой клас веб-сервиса:

public class Service : System.Web.Services.WebService
{
    private System.Windows.Forms.Form newfrm;
    private AudioSoundEditor.AudioSoundEditor audioSoundEditor1;
    public string str = "";

    public Service ()
    {
        InitializeComponent();
    }

    public void InitializeComponent()
    {
        this.newfrm = new System.Windows.Forms.Form();
        this.audioSoundEditor1 = new AudioSoundEditor.AudioSoundEditor();
        // 
        // audioSoundEditor1
        // 
        this.audioSoundEditor1.AutoSize = true;
        this.audioSoundEditor1.Location = new System.Drawing.Point(0, 0);
        this.audioSoundEditor1.Name = "audioSoundEditor1";
        this.audioSoundEditor1.Size = new System.Drawing.Size(48, 48);
        this.audioSoundEditor1.TabIndex = 0;
        this.audioSoundEditor1.SoundLoadingStarted += new AudioSoundEditor.AudioSoundEditor.EventHandler(this.audioSoundEditor1_SoundLoadingStarted);
        this.audioSoundEditor1.SoundLoadingDone += new AudioSoundEditor.AudioSoundEditor.SoundLoadingDoneEventHandler(this.audioSoundEditor1_SoundLoadingDone);
        // 
        // newfrm
        // 
        this.newfrm.ClientSize = new System.Drawing.Size(292, 266);
        this.newfrm.Location = new System.Drawing.Point(110, 145);
        this.newfrm.Name = "newfrm";
        this.newfrm.Visible = false;
        this.newfrm.Controls.Add(this.audioSoundEditor1);
    }

    public void audioSoundEditor1_SoundLoadingStarted(object sender, EventArgs e)
    {
        str += "Start Sound Loading";
    }

    public void audioSoundEditor1_SoundLoadingDone(object sender, SoundLoadingDoneEventArgs e)
    {
        str += "End Sound Loading";
    }

    [WebMethod]
    public string Run()
    {
        audioSoundEditor1.InitEditor();
        audioSoundEditor1.CloseSound();
        string myfile = @"D:\\voice\\02D3B4FC-0713-DD11-9E10-00145E6E07B4.wav";
        audioSoundEditor1.SetLoadingMode(enumLoadingModes.LOAD_MODE_NEW);
        audioSoundEditor1.LoadSound(myfile);
        return str;
    }
}


Может кто сталкивался с подобной задачей или имеет другое решение, помогите плиззз, уже вообще замучился!
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.