后台部分源码:
using NAudio.Wave;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.IO;
using System.Threading.Tasks;
using System.Windows;
namespace WpfApp1
{
///
/// MainWindow.xaml 的交互逻辑
///
public partial class MainWindow : Window, INotifyPropertyChanged
{
NAudioRecorder recorder;
NAudioReader aggregator;
ObservableCollection recordList;
WaveOut waveOutDevice;
int recordTime;
string currentState;
string outputFolder;
object lockList = new object();
bool boolPlay = false;
string strPlayAddress;
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChanged(string name)
{
if (PropertyChanged != null)
{
this.PropertyChanged(this, new PropertyChangedEventArgs(name));
}
}
/// /// 录音时长
///
public int RecordTime
{
get { return recordTime; }
set
{
recordTime = value;
this.OnPropertyChan