Skip to content

Commit 93b521b

Browse files
Next WiimoteAudioPlayer Release 1.0.1
* Improved PCM playback (still playable, but you can not barely make out the faintest sign of intelligible audio) * More use of following Wiibrew Wiimote documentation. * A TON of helpful tooltips in the audio player, to explain what should be known. * Support for PCM playback in the audio player. * Fixed Bolded text for volume and sample rate spinners being incorrectly switched. * Fixed missing required wave conversion during change in Audio sample rate. * Wiimote Audio Player no longer requires WiimoteController.exe to function as a library. * More changes to pairing system. Added Bluetooth PairOnDiscovered option. AutoConnect is now enabled by default like before.
1 parent 79f6b6b commit 93b521b

62 files changed

Lines changed: 752 additions & 101 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ReportInspector/MainWindow.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ public MainWindow() {
4242
Close();
4343
return;*/
4444

45-
//FIXME: AutoConnect/Unpair is broken on Windows 10, it'll cause
45+
//FIXME: UnpairOnDisconnect is broken on Windows 10, it'll cause
4646
// more problems than solve them at this point in time.
47-
WiimoteManager.AutoConnect = false;// true;
47+
WiimoteManager.AutoConnect = true;
4848
WiimoteManager.AutoDiscoveryCount = 1;
4949
WiimoteManager.DolphinBarMode = true;
5050
WiimoteManager.BluetoothMode = true;

ReportInspector/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
// General Information about an assembly is controlled through the following
88
// set of attributes. Change these attribute values to modify the information
99
// associated with an assembly.
10-
[assembly: AssemblyTitle("ReportInspector")]
10+
[assembly: AssemblyTitle("Wiimote Report Inspector")]
1111
[assembly: AssemblyDescription("")]
1212
[assembly: AssemblyConfiguration("")]
13-
[assembly: AssemblyCompany("")]
13+
[assembly: AssemblyCompany("Trigger's Tools & Games")]
1414
[assembly: AssemblyProduct("ReportInspector")]
15-
[assembly: AssemblyCopyright("Copyright © 2018")]
15+
[assembly: AssemblyCopyright("Copyright © Robert Jordan 2019")]
1616
[assembly: AssemblyTrademark("")]
1717
[assembly: AssemblyCulture("")]
1818

WiimoteAudioPlayer/MainWindow.xaml

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
55
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
66
xmlns:local="clr-namespace:WiimoteAudioPlayer"
7-
xmlns:local2="clr-namespace:WiimoteController.Controls;assembly=WiimoteController"
87
xmlns:xctk="clr-namespace:Xceed.Wpf.Toolkit;assembly=Xceed.Wpf.Toolkit"
98
mc:Ignorable="d"
109
Title="Wiimote Audio Player" Height="430" Width="500" Background="#FFF0F0F0" Icon="App.ico" UseLayoutRounding="True" SnapsToDevicePixels="True" ResizeMode="NoResize" AllowDrop="True" DragEnter="OnDragEnter" DragLeave="OnDragLeave" DragOver="OnDragOver" Drop="OnDrop" Loaded="OnLoaded" Closed="OnClosed">
10+
<!--
11+
xmlns:local2="clr-namespace:WiimoteController.Controls;assembly=WiimoteController"
12+
-->
1113
<Grid>
1214
<Grid.ColumnDefinitions>
1315
<ColumnDefinition Width="0"/>
@@ -25,14 +27,13 @@
2527
</Grid.ColumnDefinitions>
2628
<local:WaveformDisplay x:Name="waveform" Margin="5" VerticalAlignment="Top" Grid.ColumnSpan="2"/>
2729
<Border BorderThickness="1" BorderBrush="DarkGray" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="Auto" Margin="5" Grid.Column="1">
28-
<local2:WiimoteDisplay x:Name="wmDisplay" Height="230" Width="Auto" />
30+
<local:WiimoteDisplay x:Name="wmDisplay" Height="230" Width="Auto" />
2931
</Border>
3032
<Border x:Name="borderBattery" BorderBrush="DarkGray" Margin="5" Grid.Column="1" VerticalAlignment="Bottom" Height="20" BorderThickness="1" Background="#FF3C3C3C">
3133
<Rectangle x:Name="rectBattery" Fill="LimeGreen" HorizontalAlignment="Left" />
3234
</Border>
3335
<StackPanel VerticalAlignment="Bottom" Margin="5,0,0,5">
3436
<Label x:Name="labelFile" Content="File:" FontWeight="Regular" Margin="0,5,0,0"/>
35-
<CheckBox x:Name="checkBoxMaximize" Content="Maximize Volume" Padding="4,-1,0,0" Margin="4,2,0,0" IsChecked="True" Click="OnMaximizeVolumeChanged" />
3637
<Grid VerticalAlignment="Bottom" Margin="0,5,0,0">
3738
<Grid.ColumnDefinitions>
3839
<ColumnDefinition Width="Auto"/>
@@ -41,16 +42,40 @@
4142
<ColumnDefinition Width="Auto"/>
4243
<ColumnDefinition Width="*"/>
4344
</Grid.ColumnDefinitions>
45+
<Grid.RowDefinitions>
46+
<RowDefinition Height="Auto"/>
47+
<RowDefinition Height="5"/>
48+
<RowDefinition Height="Auto"/>
49+
</Grid.RowDefinitions>
50+
<Label x:Name="labelSampleRate" Content="Sample Rate:" Grid.Column="0" Grid.Row="2" FontWeight="Regular" Padding="5,4"/>
51+
<xctk:IntegerUpDown x:Name="spinnerSampleRate" Grid.Column="1" Grid.Row="2" Value="3000" Maximum="5000" Minimum="1000" Height="24" ValueChanged="OnSampleRateChanged" DefaultValue="3000" Increment="500" ToolTip="Recommended: ADPCM 3000Hz | PCM 1500Hz"/>
52+
<Label x:Name="labelVolume" Content="Volume:" Grid.Column="3" Grid.Row="2" FontWeight="Regular" Padding="5,4"/>
53+
<xctk:SingleUpDown x:Name="spinnerVolume" Grid.Column="4" Grid.Row="2" Value="1" Maximum="1" Minimum="0.01" Height="24" ValueChanged="OnVolumeChanged" Increment="0.05" DefaultValue="1" DisplayDefaultValueOnEmptyText="True" FormatString="0.000" ToolTip="Recommended: ADPCM 1.0 | PCM 0.2-0.4"/>
54+
<CheckBox x:Name="checkBoxADPCM" Content="ADPCM" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0" Padding="4,-1,0,0" Margin="4,2,0,0" IsChecked="True" Click="OnADPCMChanged" HorizontalAlignment="Left" ToolTip="Checked: ADPCM format | Unchecked: PCM format" />
55+
<CheckBox x:Name="checkBoxMaximize" Content="Maximize Volume" Grid.Column="3" Grid.ColumnSpan="2" Grid.Row="0" Padding="4,-1,0,0" Margin="4,2,0,0" IsChecked="True" Click="OnMaximizeVolumeChanged" HorizontalAlignment="Left" ToolTip="Recommended: ADPCM on | PCM off" />
56+
</Grid>
57+
<!-- <CheckBox x:Name="checkBoxMaximize" Content="Maximize Volume" Grid.Column="4" Padding="4,-1,0,0" Margin="4,2,0,0" IsChecked="True" Click="OnMaximizeVolumeChanged" />
58+
<Grid VerticalAlignment="Bottom" Margin="0,5,0,0">
59+
<Grid.ColumnDefinitions>
60+
<ColumnDefinition Width="Auto"/>
61+
<ColumnDefinition Width="*"/>
62+
<ColumnDefinition Width="5"/>
63+
<ColumnDefinition Width="Auto"/>
64+
<ColumnDefinition Width="*"/>
65+
</Grid.ColumnDefinitions>
66+
<Grid.RowDefinitions>
67+
<RowDefinition Height="Auto"/>
68+
</Grid.RowDefinitions>
4469
<Label x:Name="labelSampleRate" Content="Sample Rate:" FontWeight="Regular" Grid.Column="0" Padding="5,4"/>
4570
<xctk:IntegerUpDown x:Name="spinnerSampleRate" Value="3000" Maximum="5000" Minimum="1000" Height="24" Grid.Column="1" ValueChanged="OnSampleRateChanged" DefaultValue="3000" Increment="500"/>
4671
<Label x:Name="labelVolume" Content="Volume:" FontWeight="Regular" Grid.Column="3" Padding="5,4"/>
4772
<xctk:SingleUpDown x:Name="spinnerVolume" Value="1" Maximum="1" Minimum="0.01" Height="24" Grid.Column="4" ValueChanged="OnVolumeChanged" Increment="0.05" DefaultValue="1" DisplayDefaultValueOnEmptyText="True" FormatString="0.000"/>
48-
</Grid>
49-
<Button x:Name="buttonUpdateSampleRate" Content="Update Changes" VerticalAlignment="Bottom" FontWeight="Bold" Height="28" Margin="0,5,0,0" Click="OnUpdateSettings" IsEnabled="False" IsTabStop="False" Focusable="False"/>
50-
<Button x:Name="buttonPlayWave" Content="Play on Computer" VerticalAlignment="Bottom" FontWeight="Bold" Height="28" Margin="0,5,0,0" Click="OnPlayReal" IsEnabled="False" IsTabStop="False" Focusable="False"/>
51-
<Button x:Name="buttonPlayWiimote" Content="Play on Wiimote" VerticalAlignment="Bottom" FontWeight="Bold" Height="28" Margin="0,5,0,0" Click="OnPlayWiimote" IsEnabled="False" IsTabStop="False" Focusable="False"/>
52-
<Button x:Name="buttonStop" Content="Stop Playback" VerticalAlignment="Bottom" FontWeight="Bold" Height="28" Margin="0,5,0,0" Click="OnStop" IsEnabled="False" IsTabStop="False" Focusable="False"/>
53-
<Button x:Name="buttonLoadSound" Content="Load Sound" VerticalAlignment="Bottom" FontWeight="Bold" Height="28" Margin="0,5,0,0" Click="OnLoadSound" IsEnabled="True" IsTabStop="False" Focusable="False"/>
73+
</Grid>-->
74+
<Button x:Name="buttonUpdateSampleRate" Content="Update Changes" VerticalAlignment="Bottom" FontWeight="Bold" Height="28" Margin="0,5,0,0" Click="OnUpdateSettings" IsEnabled="False" IsTabStop="False" Focusable="False" ToolTip="Controls above with bold text require updating"/>
75+
<Button x:Name="buttonPlayWave" Content="Play on Computer" VerticalAlignment="Bottom" FontWeight="Bold" Height="28" Margin="0,5,0,0" Click="OnPlayReal" IsEnabled="False" IsTabStop="False" Focusable="False" ToolTip="Play converted audio through computer speakers (as PCM)"/>
76+
<Button x:Name="buttonPlayWiimote" Content="Play on Wiimote" VerticalAlignment="Bottom" FontWeight="Bold" Height="28" Margin="0,5,0,0" Click="OnPlayWiimote" IsEnabled="False" IsTabStop="False" Focusable="False" ToolTip="Play converted audio through Wiimote speaker"/>
77+
<Button x:Name="buttonStop" Content="Stop Playback" VerticalAlignment="Bottom" FontWeight="Bold" Height="28" Margin="0,5,0,0" Click="OnStop" IsEnabled="False" IsTabStop="False" Focusable="False" ToolTip="Stop audio playback on Wiimote or computer"/>
78+
<Button x:Name="buttonLoadSound" Content="Load Sound" VerticalAlignment="Bottom" FontWeight="Bold" Height="28" Margin="0,5,0,0" Click="OnLoadSound" IsEnabled="True" IsTabStop="False" Focusable="False" ToolTip="You may also drag a sound file into the window"/>
5479
</StackPanel>
5580
</Grid>
5681
<Label x:Name="labelDrop" Content="Drop Sound Files Here" Grid.ColumnSpan="2" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Background="#88FFFFFF" Opacity="0.8" FontSize="22" FontWeight="Bold" Visibility="Collapsed"/>

WiimoteAudioPlayer/MainWindow.xaml.cs

Lines changed: 114 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,15 @@ public MainWindow() {
3535
private int sampleRate = 3000;
3636
private float volume = 1f;
3737
private bool maximize = true;
38+
private int convertedSampleRate = 0;
3839

40+
private SpeakerFormat speakerFormat = SpeakerFormat.PCM;
3941
private string waveFile;
4042
private string convertedWaveFile;
4143
private string finalWaveFile;
42-
private byte[] adpcm;
44+
private object soundObj;
45+
//private byte[] soundData;
46+
//private PrebufferedSound prebufferedSound;
4347

4448
private void OnLoadSound(object sender, RoutedEventArgs e) {
4549
OpenFileDialog dialog = new OpenFileDialog {
@@ -50,17 +54,18 @@ private void OnLoadSound(object sender, RoutedEventArgs e) {
5054
}
5155

5256
private void LoadSound(string newWaveFile) {
53-
player.Close();
57+
/*player.Close();
5458
Wiimote?.StopSound();
5559
waveform.Stop();
56-
Thread.Sleep(300);
60+
Thread.Sleep(300);*/
5761

58-
int newSampleRate = sampleRate;
59-
string newConvertedWaveFile;
60-
ADPCMConverter.ConvertToValidWav(newWaveFile, out newConvertedWaveFile, ref newSampleRate);
61-
if (UpdateWaveFile(newConvertedWaveFile, newSampleRate, volume, maximize, true)) {
62-
waveFile = newWaveFile;
63-
labelFile.Content = "File: " + Path.GetFileName(waveFile);
62+
//int newSampleRate = sampleRate;
63+
//string newConvertedWaveFile;
64+
//ADPCMConverter.ConvertToValidWav(newWaveFile, out newConvertedWaveFile, ref newSampleRate);
65+
//if (PrepareWaveFile(newConvertedWaveFile, newSampleRate, volume, maximize, true)) {
66+
if (PrepareWaveFile(newWaveFile, sampleRate, volume, maximize, speakerFormat, true)) {
67+
//waveFile = newWaveFile;
68+
labelFile.Content = "File: " + Path.GetFileName(newWaveFile);
6469
buttonPlayWave.IsEnabled = true;
6570
buttonPlayWiimote.IsEnabled = WiimoteManager.ConnectedWiimotes.Any();
6671
buttonStop.IsEnabled = true;
@@ -77,13 +82,23 @@ private void OnPlayReal(object sender, RoutedEventArgs e) {
7782

7883
private void OnPlayWiimote(object sender, RoutedEventArgs e) {
7984
player.Stop();
80-
Wiimote?.EnableSpeaker(new SpeakerConfiguration {
85+
SpeakerConfiguration config = new SpeakerConfiguration {
8186
Volume = volume,
8287
//Unknown2 = 0x0c,
8388
//Unknown3 = 0x0e,
8489
SampleRate = sampleRate,
85-
});
86-
Wiimote?.PlaySound(adpcm);
90+
Format = speakerFormat,
91+
};
92+
Wiimote?.DisableSpeaker();
93+
Wiimote?.EnableSpeaker(config);
94+
Thread.Sleep(100);
95+
Wiimote?.DisableSpeaker();
96+
Wiimote?.EnableSpeaker(config);
97+
//byte[] configData = Wiimote.ReadData(0x04a20001, 7);
98+
//if (soundObj is PrebufferedSound prebuffered)
99+
// Wiimote?.PlaySound(prebuffered);
100+
//else
101+
Wiimote?.PlaySound((byte[]) soundObj);
87102
waveform.Play();
88103
}
89104

@@ -96,7 +111,7 @@ private void UpdateBattery() {
96111
}
97112

98113
private void OnSampleRateChanged(object sender, RoutedPropertyChangedEventArgs<object> e) {
99-
if (IsLoaded && adpcm != null) {
114+
if (IsLoaded && soundObj != null) {
100115
labelSampleRate.FontWeight = SampleRateFontWeight;
101116
}
102117
}
@@ -137,20 +152,31 @@ private void OnDrop(object sender, DragEventArgs e) {
137152
}
138153

139154
private void OnLoaded(object sender, RoutedEventArgs e) {
140-
//FIXME: AutoConnect/Unpair is broken on Windows 10, it'll cause
155+
speakerFormat = SpeakerFormat.ADPCM;
156+
maximize = true;
157+
checkBoxMaximize.IsChecked = maximize;
158+
if (speakerFormat == SpeakerFormat.ADPCM)
159+
sampleRate = 3000;
160+
else
161+
sampleRate = 2000;
162+
spinnerSampleRate.Value = sampleRate;
163+
CheckBoxSpeakerFormat = speakerFormat;
164+
//FIXME: UnpairOnDisconnect is broken on Windows 10, it'll cause
141165
// more problems than solve them at this point in time.
142-
WiimoteManager.AutoConnect = false;// true;
166+
WiimoteManager.UnpairOnDisconnect = false;// true;
167+
WiimoteManager.PairOnDiscover = false;// true;
168+
WiimoteManager.AutoConnect = true;
169+
WiimoteManager.AutoDiscoveryCount = 1;
143170
WiimoteManager.DolphinBarMode = true;
144171
WiimoteManager.BluetoothMode = true;
145-
WiimoteManager.AutoDiscoveryCount = 1;
146172
WiimoteManager.Connected += OnWiimoteConnected;
147173
WiimoteManager.Disconnected += OnWiimoteDisconnected;
148174
UpdateBattery();
149175
}
150176

151177
private void OnWiimoteConnected(object sender, WiimoteEventArgs e) {
152178
Dispatcher.Invoke(() => {
153-
buttonPlayWiimote.IsEnabled = adpcm != null;
179+
buttonPlayWiimote.IsEnabled = soundObj != null;
154180
UpdateBattery();
155181
});
156182
}
@@ -179,61 +205,113 @@ private void OnUpdateSettings(object sender, RoutedEventArgs e) {
179205
int newSampleRate = spinnerSampleRate.Value ?? sampleRate;
180206
float newVolume = spinnerVolume.Value ?? volume;
181207
bool newMaximize = checkBoxMaximize.IsChecked ?? maximize;
182-
UpdateWaveFile(newSampleRate, newVolume, newMaximize);
208+
SpeakerFormat newSpeakerFormat = CheckBoxSpeakerFormat;
209+
UpdateWaveFile(newSampleRate, newVolume, newMaximize, newSpeakerFormat);
183210
}
184211

185212
private void OnVolumeChanged(object sender, RoutedPropertyChangedEventArgs<object> e) {
186-
if (IsLoaded && adpcm != null) {
213+
if (IsLoaded && soundObj != null) {
187214
labelVolume.FontWeight = VolumeFontWeight;
188215
}
189216
}
190217

191218
private void OnMaximizeVolumeChanged(object sender, RoutedEventArgs e) {
192-
if (IsLoaded && adpcm != null) {
219+
if (IsLoaded && soundObj != null) {
193220
checkBoxMaximize.FontWeight = MaximizeFontWeight;
194221
}
195222
}
196223

197-
private FontWeight VolumeFontWeight {
198-
get => ((spinnerSampleRate.Value ?? 0) == sampleRate ? FontWeights.Bold : FontWeights.Regular);
224+
private void OnADPCMChanged(object sender, RoutedEventArgs e) {
225+
if (IsLoaded && soundObj != null) {
226+
checkBoxADPCM.FontWeight = ADPCMFontWeight;
227+
}
228+
}
229+
private SpeakerFormat CheckBoxSpeakerFormat {
230+
get => ((checkBoxADPCM.IsChecked??true) ? SpeakerFormat.ADPCM : SpeakerFormat.PCM);
231+
set => checkBoxADPCM.IsChecked = (value == SpeakerFormat.ADPCM);
199232
}
200233

201234
private FontWeight SampleRateFontWeight {
202-
get => ((spinnerVolume.Value ?? 0f) == volume ? FontWeights.Bold : FontWeights.Regular);
235+
get => ((spinnerSampleRate.Value ?? 0) != sampleRate ? FontWeights.Bold : FontWeights.Regular);
236+
}
237+
238+
private FontWeight VolumeFontWeight {
239+
get => ((spinnerVolume.Value ?? 0f) != volume ? FontWeights.Bold : FontWeights.Regular);
203240
}
204241

205242
private FontWeight MaximizeFontWeight {
206-
get => ((checkBoxMaximize.IsChecked ?? true) == maximize ? FontWeights.Bold : FontWeights.Regular);
243+
get => ((checkBoxMaximize.IsChecked ?? true) != maximize ? FontWeights.Bold : FontWeights.Regular);
207244
}
208245

209-
private bool UpdateWaveFile(int newSampleRate, float newVolume, bool newMaximize) {
210-
return UpdateWaveFile(convertedWaveFile, newSampleRate, newVolume, newMaximize);
246+
private FontWeight ADPCMFontWeight {
247+
get => (CheckBoxSpeakerFormat != speakerFormat ? FontWeights.Bold : FontWeights.Regular);
211248
}
212249

213-
private bool UpdateWaveFile(string newConvertedWaveFile, int newSampleRate, float newVolume, bool newMaximize, bool alreadyStopped = false) {
214-
try {
215-
if (!alreadyStopped) {
216-
player.Close();
217-
Wiimote?.StopSound();
218-
waveform.Stop();
219-
Thread.Sleep(300);
220-
}
250+
private bool ConvertWaveFile(string newWaveFile, out string newConvertedWaveFile, bool forceConvert, int newSampleRate) {
251+
if (forceConvert || newWaveFile != waveFile || newSampleRate != convertedSampleRate) {
252+
ADPCMConverter.ConvertToValidWav(newWaveFile, out newConvertedWaveFile, ref newSampleRate);
253+
waveFile = newWaveFile;
254+
convertedWaveFile = newConvertedWaveFile;
255+
convertedSampleRate = newSampleRate;
256+
//labelFile.Content = "File: " + Path.GetFileName(waveFile);
257+
//buttonPlayWave.IsEnabled = true;
258+
//buttonPlayWiimote.IsEnabled = WiimoteManager.ConnectedWiimotes.Any();
259+
//buttonStop.IsEnabled = true;
260+
//buttonUpdateSampleRate.IsEnabled = true;
261+
return true;
262+
}
263+
convertedWaveFile = waveFile;
264+
newConvertedWaveFile = waveFile;
265+
return false;
266+
}
221267

268+
private bool UpdateWaveFile(int newSampleRate, float newVolume, bool newMaximize, SpeakerFormat newSpeakerFormat) {
269+
return PrepareWaveFile(waveFile, newSampleRate, newVolume, newMaximize, newSpeakerFormat, false);
270+
}
271+
272+
//private bool UpdateWaveFile(string newConvertedWaveFile, int newSampleRate, float newVolume, bool newMaximize, bool shouldStop = false) {
273+
private bool PrepareWaveFile(string newWaveFile, int newSampleRate, float newVolume, bool newMaximize, SpeakerFormat newSpeakerFormat, bool forceConvert = true, bool stop = true) {
274+
if (stop) {
275+
player.Close();
276+
Wiimote?.StopSound();
277+
waveform.Stop();
278+
Thread.Sleep(300);
279+
}
280+
281+
try {
282+
string newConvertedWaveFile;
283+
ConvertWaveFile(newWaveFile, out newConvertedWaveFile, /*forceConvert*/true, newSampleRate);
222284
string newFinalWaveFile = newConvertedWaveFile;
223285
if (newMaximize)
224286
ADPCMConverter.MaximizeWavVolume(newConvertedWaveFile, out newFinalWaveFile);
225-
byte[] data = ADPCMConverter.Wav2ADPCMData(newFinalWaveFile, out newSampleRate);
287+
object newSoundObj = null;
288+
byte[] data = null;
289+
if (newSpeakerFormat == SpeakerFormat.ADPCM) {
290+
//newSoundObj = WiiRemoteJAudioConverter.bufferADPCMSound(newFinalWaveFile);
291+
data = ADPCMConverter.Wav2ADPCMData(newFinalWaveFile, out newSampleRate);
292+
}
293+
else {
294+
data = ADPCMConverter.Wav2PCMs8Data(newFinalWaveFile, out newSampleRate);
295+
//throw new NotSupportedException("8-bit signed PCM not supported yet!");
296+
//newSoundObj = WiiRemoteJAudioConverter.bufferPCMs8Sound(newFinalWaveFile);
297+
//data = ADPCMConverter.Wav2PCMs8Data(newFinalWaveFile, out newSampleRate);
298+
//TODO: We probably dont need to previous step, it'll make things more complicated
299+
}
226300
player.Open(new Uri(newFinalWaveFile));
227301
waveform.InitWave(newFinalWaveFile);
228-
adpcm = data;
302+
soundObj = newSoundObj ?? data;
303+
//soundObj = newSoundObj;
304+
//soundData = data;
229305
convertedWaveFile = newConvertedWaveFile;
230306
finalWaveFile = newFinalWaveFile;
231307
sampleRate = newSampleRate;
232308
volume = newVolume;
233309
maximize = newMaximize;
310+
speakerFormat = newSpeakerFormat;
234311
labelSampleRate.FontWeight = SampleRateFontWeight;
235312
labelVolume.FontWeight = VolumeFontWeight;
236313
checkBoxMaximize.FontWeight = MaximizeFontWeight;
314+
checkBoxADPCM.FontWeight = ADPCMFontWeight;
237315
return true;
238316
}
239317
catch (Exception ex) {

0 commit comments

Comments
 (0)