We should NEVER try to add samples to the wave provider in a for loop like this

pull/1/head
firealarmss 11 months ago
parent 4313ac835b
commit 88de858b1e

@ -326,7 +326,7 @@ namespace WhackerLinkConsoleV2
private void WaveIn_DataAvailable(object sender, WaveInEventArgs e)
{
foreach (ChannelBox channel in _selectedChannelsManager.GetSelectedChannels())
foreach ( ChannelBox channel in _selectedChannelsManager.GetSelectedChannels())
{
Codeplug.System system = Codeplug.GetSystemForChannel(channel.ChannelName);
Codeplug.Channel cpgChannel = Codeplug.GetChannelByName(channel.ChannelName);
@ -659,6 +659,8 @@ namespace WhackerLinkConsoleV2
private void HandleReceivedAudio(AudioPacket audioPacket)
{
bool shouldReceive = false;
foreach (ChannelBox channel in _selectedChannelsManager.GetSelectedChannels())
{
Codeplug.System system = Codeplug.GetSystemForChannel(channel.ChannelName);
@ -670,6 +672,10 @@ namespace WhackerLinkConsoleV2
_waveProvider.AddSamples(audioPacket.Data, 0, audioPacket.Data.Length);
}
}
if (shouldReceive)
_waveProvider.AddSamples(audioPacket.Data, 0, audioPacket.Data.Length);
}
private void HandleVoiceRelease(GRP_VCH_RLS response)

@ -8,9 +8,9 @@ radioWide:
systems:
- name: "System 1"
address: "localhost"
port: 3009
rid: "123456"
address: "fne.zone1.scan.stream"
port: 3015
rid: "12345"
site:
name: "Central Site"
controlChannel: "772.74375"

Loading…
Cancel
Save

Powered by TurnKey Linux.