第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

將音頻錄制到內(nèi)存流中,然后將其保存到文件中

將音頻錄制到內(nèi)存流中,然后將其保存到文件中

C#
慕無忌1623718 2021-06-22 17:13:02
您無需再次聲明該事件。如果它是公共的并且在需要時已經(jīng)被拋出,您可以根據(jù)需要通過訂閱基類事件來處理更改。我的意思是,您可以執(zhí)行以下操作:using System;using System.Windows.Forms;namespace DRT{    internal abstract partial class DRT_ComboBox_Abstract : ComboBox    {        public DRT_ComboBox_Abstract()        {            InitializeComponent();            SelectedValueChanged += MyOwnHandler        }        protected virtual void MyOwnHandler(object sender, EventArgs args)        {            // Hmn.. now I know that the selection has changed and can so somethig from here            // This method is acting like a simple client        }    }}在S O LID類上(我相信 是這種情況ComboBox),通常有效調(diào)用訂閱者來處理某些事件的方法通常是虛擬的,一旦您從此類繼承,就允許您攔截事件處理程序調(diào)用,如果這是你想要的。這是:using System;using System.Windows.Forms;namespace DRT{    internal abstract partial class DRT_ComboBox_Abstract : ComboBox    {        public DRT_ComboBox_Abstract()        {            InitializeComponent();        }        protected override void OnSelectedValueChanged(object sender, EventArgs args)        {            // Wait, the base class is attempting to notify the subscribers that Selected Value has Changed! Let me do something before that            // This method is intercepting the event notification            // Do stuff            // Continue throwing the notification            base.OnSelectedValueChanged(sender, args);        }    }}
查看完整描述

2 回答

?
qq_花開花謝_0

TA貢獻1835條經(jīng)驗 獲得超7個贊

試試這個:


using(var fileWriter = new WaveFileWriter("yourOutputFile", SampleProvider.WaveFormat)

{

    ResourceWaveStream.CopyTo(fileWriter);

}

順便說一句,這里的“使用”塊對您有好處,因為它會自動處理編寫器,允許 WaveFileWriter 將標(biāo)頭寫入文件。


查看完整回答
反對 回復(fù) 2021-06-27
?
眼眸繁星

TA貢獻1873條經(jīng)驗 獲得超9個贊

好的,我終于有了解決方案。首先,我將聲音數(shù)據(jù)直接復(fù)制到內(nèi)存流中。然后當(dāng)我需要它時,我將整個內(nèi)存流讀入 a RawSourceWaveStream,然后將其傳遞給最終的WaveFileWriter. 如果有人對我的具體做法感興趣,請給我留言。



查看完整回答
反對 回復(fù) 2021-06-27
  • 2 回答
  • 0 關(guān)注
  • 244 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號