ProgressBar1.Value = (int)(listener.AmplitudeFrac * progressBar1.Maximum) double newAudio = listener.GetNewAudio() Private void timer1_Tick(object sender, EventArgs e) Listener2 = new Listener(cbDevice2.SelectedIndex, sampleRate) Listener = new Listener(cbDevice.SelectedIndex, sampleRate) Private void cbDevice2_SelectedIndexChanged(object sender, EventArgs e) => StartListening() "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error) MessageBox.Show("No audio input devices found.\n\nThis program will now exit.", Public partial class frmTestRecordSignal : Form Is that Main method ever actually executed? If so then it definitely ought to have a different name. You have a Main method - Main should be the entry point for the application so you should not use that name anywhere else - but it's referring to controls as though a form already exists. what you're trying to achieve, how you're trying to achieve it, what happens when you try and how that differs from your expectations. Code comments may help but your post should contain a FULL and CLEAR explanation of the problem, i.e. That's not where you should describe the issue. I notice that you have some comments in the code. You can then tell us about the difference in behaviour not just from the perspective of the application but also the code. WaveSource.WaveFormat = new (rate: sampleRate, bits: 16, channels: 1) įor (int i = 0 i MessageBox.Show("Sound Stopped! Cannot capture sound from device.") Ĭould you please describe the actual issue in detail? What EXACTLY happens that you don't expect or doesn't happen that you do expect? Have you debugged the code to see exactly how it behaves? If not then you ought to do so, although it can be tricky in multithreaded scenarios. Void RecordMicNAudio(int deviceNum, double AudioVals) auto-scale the maximum progressbar level VolumeSignal volumeSignal = (VolumeSignal)msg Things just doesn't look right if that were truly your main entry point for the program. Also note that questions above regarding Main(). Public ProgressBar Progress, 1000, 500) If it is being called, but the progress bars are not updating, it's likely because of the callbacks are called on a thread pool thread, but your UI was created and runs on the UI thread.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |