History

Merge pull request #57 from martinellimarco/master

Fix for #56

Marco Martinelli committed 7 years ago

Commit 4166b802 parents 6b1a111 1630e463 files · +12 −13Browse files

Unified · Split

3 files
  1. Receivers/dotnet-windows/ScreamReader/ScreamReader/ScreamReader.csproj +2 −2
  2. Receivers/dotnet-windows/ScreamReader/ScreamReader/UdpWaveStreamPlayer.cs +9 −10
  3. Receivers/dotnet-windows/ScreamReader/ScreamReader/packages.config +1 −1
Receivers/dotnet-windows/ScreamReader/ScreamReader/ScreamReader.csproj+2−2
@@ -38,8 +38,8 @@ · 37 unmodified lines
38 <StartupObject />38 <StartupObject />
39 </PropertyGroup>39 </PropertyGroup>
40 <ItemGroup>40 <ItemGroup>
41 <Reference Include="NAudio, Version=1.8.5.0, Culture=neutral, processorArchitecture=MSIL">41 <Reference Include="NAudio, Version=1.9.0.0, Culture=neutral, processorArchitecture=MSIL">
42 <HintPath>..\packages\NAudio.1.8.5\lib\net35\NAudio.dll</HintPath>42 <HintPath>..\packages\NAudio.1.9.0\lib\net35\NAudio.dll</HintPath>
43 </Reference>43 </Reference>
44 <Reference Include="System" />44 <Reference Include="System" />
45 <Reference Include="System.Core" />45 <Reference Include="System.Core" />
Receivers/dotnet-windows/ScreamReader/ScreamReader/UdpWaveStreamPlayer.cs+9−10
@@ -41,7 +41,7 @@ namespace ScreamReader · 40 unmodified lines
41 41
42 private UdpClient udpClient;42 private UdpClient udpClient;
43 43
44 private WaveOut output;44 private WasapiOut output;
45 45
46 private int volume;46 private int volume;
47 #endregion47 #endregion
@@ -122,10 +122,7 @@ namespace ScreamReader · 74 unmodified lines
122 122
123 var rsws = new BufferedWaveProvider(new WaveFormat(44100, currentWidth, currentChannels)) { BufferDuration = TimeSpan.FromMilliseconds(200), DiscardOnBufferOverflow = true };123 var rsws = new BufferedWaveProvider(new WaveFormat(44100, currentWidth, currentChannels)) { BufferDuration = TimeSpan.FromMilliseconds(200), DiscardOnBufferOverflow = true };
124 124
125 this.output = new WaveOut()125 this.output = new WasapiOut();
126 {
127 DesiredLatency = 200
128 };
129 this.Volume = 100;126 this.Volume = 100;
130 127
131 this.output.Init(rsws);128 this.output.Init(rsws);
@@ -151,20 +148,22 @@ namespace ScreamReader · 19 unmodified lines
151 // TODO find a way to set a channel map in NAudio. I was not able to find any.148 // TODO find a way to set a channel map in NAudio. I was not able to find any.
152 // In practice if both the source and the receiver windows machine have the same speakers configuration setted this doesn't matter,149 // In practice if both the source and the receiver windows machine have the same speakers configuration setted this doesn't matter,
153 // but in all other cases the channels will be possibly mismatched.150 // but in all other cases the channels will be possibly mismatched.
154
155 this.output.Stop();151 this.output.Stop();
156 var rate = ((currentRate >= 128) ? 44100 : 48000) * (currentRate % 128);152 var rate = ((currentRate >= 128) ? 44100 : 48000) * (currentRate % 128);
153
157 rsws = new BufferedWaveProvider(new WaveFormat(rate, currentWidth, currentChannels)) { BufferDuration = TimeSpan.FromMilliseconds(200), DiscardOnBufferOverflow = true };154 rsws = new BufferedWaveProvider(new WaveFormat(rate, currentWidth, currentChannels)) { BufferDuration = TimeSpan.FromMilliseconds(200), DiscardOnBufferOverflow = true };
158 this.output = new WaveOut()155 this.output = new WasapiOut();
159 {
160 DesiredLatency = 200
161 };
162 this.Volume = 100;156 this.Volume = 100;
163 this.output.Init(rsws);157 this.output.Init(rsws);
164 this.output.Play();158 this.output.Play();
165 }159 }
166 rsws.AddSamples(data, 5, data.Length - 5);160 rsws.AddSamples(data, 5, data.Length - 5);
167 } catch (SocketException) { } // Usually when interrupted161 } catch (SocketException) { } // Usually when interrupted
162 catch(Exception e)
163 {
164 System.Windows.Forms.MessageBox.Show(e.StackTrace, e.Message);
165
166 }
168 }167 }
169 }, this.cancellationTokenSource.Token);168 }, this.cancellationTokenSource.Token);
170 169
Receivers/dotnet-windows/ScreamReader/ScreamReader/packages.config+1−1
@@ -1,4 +1,4 @@
1<?xml version="1.0" encoding="utf-8"?>1<?xml version="1.0" encoding="utf-8"?>
2<packages>2<packages>
3 <package id="NAudio" version="1.8.5" targetFramework="net472" />3 <package id="NAudio" version="1.9.0" targetFramework="net472" />
4</packages>4</packages>

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t