AlreadyAllocated calling waveOutOpen error

后端 未结 2 2023
暖寄归人
暖寄归人 2020-12-18 08:57
 private void receiveAudio(object sender)
        {
            IPEndPoint senderEP = new IPEndPoint(IPAddress.Any, 0);
            MemoryStream audioDataStream;
            


        
2条回答
  •  温柔的废话
    2020-12-18 09:09

    You are constantly creating WaveOut objects inside your while loop that are not disposed, which is part of the issue. The best approach in this situation is to create a single WaveOut object and to feed it using a BufferedWaveProvider. Then as audio becomes available, write it into the BufferedWaveProvider.

提交回复
热议问题