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) 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.System system = Codeplug.GetSystemForChannel(channel.ChannelName);
Codeplug.Channel cpgChannel = Codeplug.GetChannelByName(channel.ChannelName); Codeplug.Channel cpgChannel = Codeplug.GetChannelByName(channel.ChannelName);
@ -659,6 +659,8 @@ namespace WhackerLinkConsoleV2
private void HandleReceivedAudio(AudioPacket audioPacket) private void HandleReceivedAudio(AudioPacket audioPacket)
{ {
bool shouldReceive = false;
foreach (ChannelBox channel in _selectedChannelsManager.GetSelectedChannels()) foreach (ChannelBox channel in _selectedChannelsManager.GetSelectedChannels())
{ {
Codeplug.System system = Codeplug.GetSystemForChannel(channel.ChannelName); Codeplug.System system = Codeplug.GetSystemForChannel(channel.ChannelName);
@ -670,6 +672,10 @@ namespace WhackerLinkConsoleV2
_waveProvider.AddSamples(audioPacket.Data, 0, audioPacket.Data.Length); _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) private void HandleVoiceRelease(GRP_VCH_RLS response)

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

Loading…
Cancel
Save

Powered by TurnKey Linux.