 |
|
 |
The control can display up to 1000 bands. Just make sure the control is wide enough to show them.
Didn't you add the control to your toolbox? It's not that hard to use.
Try not to become a man of success but rather to become a man of value. - Albert Einstein
Ernest Laurentin
|
|
|
|
 |
|
 |
Well, my problem is not actually with the count of the bands actually. That's a minor problem.
The real problem is how to attach your control to my media player's output? For example can we put a media player activx in a winform application and show the output with your control? Or with the output from directx or something else. If so, could you please send me a code example to my mail or here?
I would appreciate your help very much. Thank you.
|
|
|
|
 |
|
 |
Ernest, you've done a great deed here. Please can you release a VB.Net version ?
|
|
|
|
 |
|
 |
Thanks but unfortunately I don't have much time right now. You can use Reflector to give you a hand.
http://www.red-gate.com/products/reflector/[^]
View the assembly and use VB.NET plug-in to view the source code.
Cheers,
Try not to become a man of success but rather to become a man of value. - Albert Einstein
Ernest Laurentin
|
|
|
|
 |
|
 |
Wow great article. I'm a graphics programmer using OpenGL and C# I've been looking for a good FFT audio analysis solution. I'm kind of oblivious when it comes to audio, so this has really helped. I wanted to implement this into a project and was wondering if it was possible building this into a class without having to use a Windows form. Any help would be greatly appreciated.
Thanks again.
|
|
|
|
 |
|
 |
And you want to use OpenGL for this kind of stuff?
You can use it with WPF but you will have to use an ElementHost. I would not recommend to use OpenGL, it's probably an overkill even if you want to have this in 3D.
Hope that helps!
Try not to become a man of success but rather to become a man of value. - Albert Einstein
Ernest Laurentin
|
|
|
|
 |
|
 |
Thanks for the prompt reply, i'm still learning how to use WPF, i'll make sure to read up on ElementHost. I'm actually using OpenGL to render a whole 3d scene and using the spectrum data to control object parameters. Thanks again, now i can get back to coding visuals.
|
|
|
|
 |
|
 |
Excellent control. Thanks.
I am trying to open your SoundStudioCS project using VC#2008Epress and I get the error
Warning 1 Could not find type 'Ernzo.WinForms.Controls.PeakMeterCtrl'. Please make sure that the assembly that contains this type is referenced. If this type is a part of your development project, make sure that the project has been successfully built
The refs to Peakmetercontrol and Windowsmedia seem to be missing.
How can I fix this ?
Also please can you post a VB.NET version of this project. Thanks !
|
|
|
|
 |
|
 |
Please just add a reference to "PeakMeterCtrl" assembly from visual project.
From "Solution Explorer", right click "References" and add the reference.
I do not have any plan to convert this to VB.NET.
Thanks for using!
Try not to become a man of success but rather to become a man of value. - Albert Einstein
Ernest Laurentin
|
|
|
|
 |
|
 |
Thanks for the reply. I replaced the refs for PeakMeterctrl & windowsMediaPlayer and it worked.
Please can you or someone consider porting the SoundStudio project to VB.Net Express Edition ?
|
|
|
|
 |
|
 |
Hi,
can anyone please expalin how can I use it with microphone, My requirement is, when I speak the peaklevel should increase and decrease as per the sound.
Thanks
|
|
|
|
 |
|
 |
Rename '__waveinput_SoundStudioFrm.cs' as 'SoundStudioFrm.cs'.
Regards,
Try not to become a man of success but rather to become a man of value. - Albert Einstein
Ernest Laurentin
|
|
|
|
 |
|
 |
Thanks a lot, it works.
Do you have the VB.Net version of this project? If yes, it will be great help.
Thanks
|
|
|
|
 |
|
 |
Good article and very good source.
This c++ souce was exactly what I needed today.
Thaks for sharing that.
Dr.Luiji
Trust and you'll be trusted.
Try iPhone UI [ ^] a new fresh face for your Windows Mobile, here on Code Project.
|
|
|
|
 |
|
 |
Thanks man!
Try not to become a man of success but rather to become a man of value. - Albert Einstein
Ernest Laurentin
|
|
|
|
 |
|
 |
we use waveOutXXX and DirectSound for output module, with waveOutXXX, system notify application by message WOM_DONE. we can get sample from WAVEHDR, but with DirectSound, it is a circle buffer, how do i get accurate position from this circle buffer?
i hope you can give me some useful suggestion?
|
|
|
|
 |
|
 |
I need some help for my project.I just wanna know how to convert microphone signals (wave) to a stream of musical notes (text stream indicating the musical notes of the signal)?
If anybody knows anything regaurding this subject pls contact me
thanks
Hashan Fernando (SLIIT)
|
|
|
|
 |
|
 |
is it possible what gets samples from directsound primary buffer and exactly playing position?
in another word, can i access directsound primary buffer and exactly play position?
modified on Friday, September 12, 2008 2:44 AM
|
|
|
|
 |
|
 |
I also once did a similar project, but used the Exocortex.DSP library for DSP stuff:
http://www.exocortex.org/dsp/[^]
It's open source, and written in C#.
|
|
|
|
 |
|
 |
hi, i got a program from codeproject which playes wave file with directsound. and i want to modify it and add spectrum support to it. but i got some questiones about it, can you help me resolve it?
question one:
the program open wave file and read wave file information to struct WAVEFORMATEX, the members of it like wFormatTag=1, nChannels=2, nSamplesPerSec=44100, nAvgBytesPerSec=176400, nBlockAlign=4, wBitsPerSample=16, cbSize=0. then program initial DirectSoundBuffer's size as 176400, we must set size to 176400, it can be set any number?
question two:
i add code to log DirectSoundBuffer's current play position and current write position to listbox control, the max value displayed in it which each of them may big than 176400, how can i get right start postion what i want to sample the buffer?
code like:
DWORD dwCurPlayPos, dwCurWritePos;
m_lpDSB->GetCurrentPosition(&dwCurPlayPos, &dwCurWritePos);
question three:
if i get right start postion of buffer, what right sample size may be suggest?
code modified by me can download here.
regards,
jacky_zz
modified on Thursday, September 4, 2008 2:31 AM
|
|
|
|
 |
|
 |
From what I can understand from your comments, you have a 44.1KHz stereo wave file (2 channels). This is the reason for 176400 (44100*(16/8)*2). This represents 1 second of raw PCM audio. It's ok to read that much memory from disk but if you want to do the FFT and show the spectrum, you should consider breaking it into smaller samples. For example, if you want 50ms samples buffer you will get roughly 8820 bytes(/per 50ms block)(or 4410 bytes/channel). You need to pass the data for each channel separately. The FFT algorithm in my article requires a buffer size multiple of 2. Sorry, I cannot give recommendations based on someone else code.
In the end, we will remember not the words of our enemies, but the silence of our friends. - Martin Luther King Jr.
Ernest Laurentin
|
|
|
|
 |
|
 |
Hi Ernest
Your wonderful code has helped me out of a tight situation. I am developing a program and wanted to convert the output audio in to amplitude and frequency information. Your code was really helpful. Since I am pretty new to C#, I am taking some time to understand the code. But I have already achieved a part of what I wanted. Can you tell me/provide me with the modified code to take the audio feed from the sound card/audio out instead of from an audio file. Your help would be appreciated much.
Thank you
|
|
|
|
 |
|
 |
Hi Deepak,
Thanks for your feedback. I believe you meant to take audio from wave input (microphone) not audio out.
Please write me directly and I will send it to you. If more people are interested, I will update the article.
Thanks
In the end, we will remember not the words of our enemies, but the silence of our friends. - Martin Luther King Jr.
Ernest Laurentin
|
|
|
|
 |
|
 |
I'd be very interested too - for monitoring both audio inputs and outputs (I have an M-Audio Deta 1010 - 8 channel analog simultaneous in and out).
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
 |
|
 |
Hi
Excellent article and wonderful control. I also would also love to know how to read directly from the sound card. Even a nudge in the right direction would do.
Fergal.
|
|
|
|
 |