11/30/2022 0 Comments Audio bar progress mathProgressBar1.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. In my test environment, the progress bar changes on click and then it immediately goes back to the right position the audio is playing, and also here the audio continues without changes. 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. In the fiddle, the progress bar changes, but the audio continues without changes. AUDIO BAR PROGRESS MATH FULLCode 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 Public ProgressBar Progress, 1000, 500)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |