private void DrawWaveRight() { if (WFRight != null) { deckBOsc.BackgroundImage = WFRight.CreateBitmap(deckBOsc.Width, deckBOsc.Height, -1, -1, false); } else { deckBOsc.BackgroundImage = null; } }
private void buttonStopRec_Click(object sender, System.EventArgs e) { Bass.BASS_ChannelStop(_recHandle); lame.Stop(); this.buttonStartRec.Enabled = true; this.labelRec.Text = "Recording stopped!"; // stop the live recording waveform if (WF != null) { WF.RenderStopRecording(); //DrawWave(); // or now draw the wole wave form... // Note: to total length is always up to how it was initialized using WF.RenderStartRecording(_recHandle, 5, 2); // This means it is either 5, 7, 9, 11,... etc. seconds long // This is why sometimes the wave form doesn't fill the full pictureBox! this.pictureBoxLiveWave.BackgroundImage = WF.CreateBitmap(this.pictureBoxLiveWave.Width, this.pictureBoxLiveWave.Height, -1, -1, true); } if (checkBoxMonitor.Checked) { checkBoxMonitor.Checked = false; } }
public void drawWave() { //time -> frame ([FrameResolution] frame : 1 secondo) //frame -> picture box //frame -> pixel //framemax = ratioconversione * maxpixel //rconversione = frame / pixel (i frame in un pixel) //int curFrame = (int)(Math.Floor(Bass.BASS_ChannelBytes2Seconds(streamHandle, Bass.BASS_ChannelGetPosition(streamHandle, BASSMode.BASS_POS_BYTES))) / waveForm.FrameResolution); //int zoom = 100; // = 5sec., since our resolution is 0.01sec. //int zoomEnd; //int zoomStart; //WaveWriter ww = new WaveWriter("wave", ); myPictureBox.BackgroundImage = myWaveForm.CreateBitmap(myPictureBox.Width, myPictureBox.Height, startFrame, endFrame, true); }