Hi, I'm doing my diploma and I'm stuck on making my spectrum to work
Please HELP me
I'm developing it in C# and using system standard TTS engine to make my program talk, and I need graphical interface for it (when program talk there should be spectrum diagram showing it on form).
I creating it by using:
pictureBoxSpectrum.Image = _vis.CreateSpectrumLinePeak(_stream, this.pictureBoxSpectrum.Width, this.pictureBoxSpectrum.Height, Color.Gray, Color.LightBlue, Color.Orange, Color.FromArgb(0, 34, 34, 34), 2, 1, 2, 10, false, false, false);
in "_stream" I must have my device (sound card), it can't be standard filestream!
So the main question - How I could do that? How to put what play my sound card into stream? Maybe it's a stupid question but I didn't find the answer
What I managed to do is trying to record what my sound card playing and putting it to stream, but it doesn't work:
private void button1_Click(object sender, System.EventArgs e)
Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero);
_myRecProc = new RECORDPROC(MyRecording);
int recHandle = Bass.BASS_RecordStart(44100, 1, BASSFlag.BASS_RECORD_PAUSE, _myRecProc, IntPtr.Zero);
// start recording
pictureBoxSpectrum.Image = _vis.CreateSpectrumLinePeak(recHandle, this.pictureBoxSpectrum.Width, this.pictureBoxSpectrum.Height, Color.Gray, Color.LightBlue, Color.Orange, Color.FromArgb(0, 34, 34, 34), 2, 1, 2, 10, false, false, false);
private unsafe bool MyRecording(int handle, IntPtr buffer, int length, IntPtr user)
bool cont = true;
if (length > 0 && buffer != IntPtr.Zero)
// assuming 16-bit sample data here
short *data = (short*)buffer;
I didn't understand how to record too.
Please help me!
P.S.: Sorry for my english.