 |

|
Someone can help me for made an operation: I'd like to extract a signal modulated on a carrier signal of 1800 MHz.
Any suggestions?
Andrea Galbarini
|
|
|
|

|
При запуске программы. На этой строке кода "WaveNative.waveInOpen(out m_WaveIn, device, format, m_BufferProc, IntPtr.Zero, WaveNative.CALLBACK_FUNCTION)" вылетает и выдает ошибку "В экземпляре объекта не задана ссылка на объект."
Что делать??
modified 4 Apr '13 - 8:07.
|
|
|
|

|
Thank you for your code very nice.
is there a way to select the input device (in case of multiple input devices) instead of the default one ?
thank you again for your code.
|
|
|
|

|
Its a brilliant code...... thank you
|
|
|
|
|

|
Very useful source
Thanks
|
|
|
|

|
this source code is usefull
and crete share
|
|
|
|

|
if input source is wav file, how to draw it's spectrogram with a limit width like 800 pixel?
|
|
|
|

|
Firstly, great example…
If there is no noise/sound the application closes fine, if there is a high level of noise and you try to close the application, it hangs… any suggestions?
i think ive traced it back to the DataArrived() sub, when you call your delagate: Invoke(new MethodInvoker(AmplitudeEvent));
it looks like this method is still getting fired even when the object is disposed, i removed _recorder.Dispose(); to invoke this error... im trying to figure this threading issue out myself but i would appreciate it if you took a look and gave some advice.
Thank you
modified 17 Jan '12 - 12:09.
|
|
|
|

|
Hi,
I am getting Object reference not set to an instance of an object error in WaveIn.cs function WaveInRecorder in the following code
WaveInHelper.Try( WaveNative.waveInOpen(out m_WaveIn, device, format, m_BufferProc, IntPtr.Zero, WaveNative.CALLBACK_FUNCTION));
?
|
|
|
|

|
Hi,
Great program - exactly what I need! One thing though: it locks up on Exit when running on Win 7 32-bit. No problems on XP, just Win 7.
I've traced it back to the Stop(); function and it seems _recorder.Dispose(); is where it locks up. If I comment that out the window will close, but the SoundCatcher.exe process is still running.
I'm very new to C# so I have no idea what to do to prevent this. Any help would be greatly appreciated!
Thank you!
|
|
|
|

|
Thanks so much for the great exposition, please how can i make it record for every one hour.
Thanks for your prompt response.
Timotech
|
|
|
|

|
Very good solution.
http://www.haxx.lv/
|
|
|
|

|
Thanks.
If is interested, then IT - In VB.NET...
IT
In VB.NET
|
|
|
|
|

|
How do i have to alter the code for the program to also output a .txt file containing amplitude and frecvency information?
|
|
|
|

|
Hi,
Thanks for this nice project..... I found that the picturebox displaying the spectrogram goes blank after sometime.... I thought that the issue is with system memory (256MB), so I upgraded to 1GB.... The problem still persists.... Any suggestions?
|
|
|
|

|
Hi, Could i use this code in a gplv2 project.
|
|
|
|

|
Hi Jeff,
I found that the method "Process(ref byte[] wave)" plays the main role here.
This method gets the appropriate byte array as the input and going further,
the methods-
"public void RenderTimeDomainRight(ref PictureBox pictureBox)"
and
"public void RenderTimeDomainLeft(ref PictureBox pictureBox)"
are displaying the waveforms.
What if I, already have with me, this "byte[] wave" byte-array for which the wave-form has to be displayed?
An audio-stream gives me this byte-array at regular intervals of time one-after-the-other.
I am currently giving this "wave" directly as input to the method i.e. "Process(ref byte[] wave)"
instead of going through all the "DataArrived" stuff.
Or is there some way I could use "ISpeechBaseStream" object to give audio stream as input ?
Please can you help.
Thanks in advance
Mark
|
|
|
|

|
Hi,
Is it possible to average the audio over a period, say a few seconds? I guess that will reduce a lot of noise. Any ideas in this direction?
|
|
|
|

|
Dear Jeff Morton,
Let us know whether or not it is possible to create a sound equalizer using this code. Would you like to guide us?
Don't believe in love...
|
|
|
|

|
Your project is great. I want to use it on my project too. The project aims to analyze sounds coming from microphone in real-time by their sound loudness or amplitude. Is this application perfect for our project?
I wanna know if it can measure the loudness of the sound. Coz I've seen the app and it displays the numeric figures in dB. I hope this is what I'm really looking for.
Thanks! Great Job!
|
|
|
|

|
Hello,
i want to use this great application to show me the loudest frequency in the fft. It works very well, the RenderFrequencyDomain allready calculates the loudest frequency.
I have to use a invoke to display this number on a textbox. The application works, i got the frequency displayed on a textbox, but i can not stop the thread.
Code in the DataArrived Methode: (i returned the maxHz in the RenderFrequencyDomainLeft)
double leftHz = _audioFrame.RenderFrequencyDomainLeft(...)
Invoke(new MethodInvoker(delegate{
textBox1.Text = leftHz.ToString() + " Hz";
}));
When i want to close the application the call stack hangs in the following step:
- FormOnClosing
-> Stop();
-> _recorder.Dispose();
-> WaitForAllBuffers();
-> Buf.WaitFor();
-> m_Recording = m_RecordEvent.WaitOne(); // The WaitOne Methode hangs
If i give a timeout to the WaitOne Methode, the closing call stack hangs in the following step:
- FormOnClosing
-> Stop();
-> _recorder.Dispose();
-> m_Thread.Join(); // The Join Methode hangs
If i give a timeout to the Join Methode, i got a objectdisposedexeption in the Invoke Methode i wrote for updating the textbox.
I want to know if there is any good solution to access user controls with an invoke in the dataarrived event. And with that i can stop the threads without timeout programming.
thx a lot
Mike
|
|
|
|

|
I made an high pass filter after the FFT and I wanted to record the result.
For that, I need to do a IFFT.
Can you tell me how do I do it with your code? tks
aF -.-
|
|
|
|

|
I am able to get the audio from wavOut class and process them to get the various displays. But there is a lot of noise. How do I reduce it? Also, the Time Domain Display does not show any significant variation of amplitude. Any way out?
|
|
|
|

|
How can I change the source to line-out instead of line-in and display the results in the same way?
|
|
|
|

|
Is it possible to change the source to an existing wav file? or alternately, capture the sound as it is being played by the system?
|
|
|
|

|
Hi!
There is a huge mistake in the source!
Exactly we have bug in Form1.cs file in the function "private void Start()":
-String, that was written by author:_waveFormat = new WaveFormat(_audioFrameSize, _audioBitsPerSample, _audioChannels);
Generally, we have "bad" sampling rate exactly due to error in WaveFormat - call, such that the first argument should be sampling rate (public WaveFormat(int rate, int bits, int channels))
!!!We should use string like: -String, that was written by author:_waveFormat = new WaveFormat(_SamplingRate, _audioBitsPerSample, _audioChannels);
So, guys... all the problems about "Error in Frequency domain" are being solved (I think so).
|
|
|
|

|
Hi Jeff
I'm using vista 64bit eddition and I can't get the program working
it always says device stopped polling seems its unable to start it in vista
do u hav any idea what is the cause of this problem??
|
|
|
|

|
I have spectrum signal and i want to play it's sound,
how can i do it????
modified on Monday, August 3, 2009 3:33 AM
|
|
|
|

|
This is really greate code you did.
It seems however the program cannot find playback devices. Is it on purpose or is it my hardware/drivers?
I need to detect certain characteristics of sound made by another program. It would be great if I could capture straight from playback.
Thank you
|
|
|
|

|
Hi, i've been testing your project and i've to say that is very nice, i've been looking for something like this sometimes.
I've been testing different "SamplesPerSecond" values, but when using values under 11025 ( minimum is 8000) it throws an exception.
The first thing i've seen is that the buffer size for AudioFrame.Process() methodmust be dividable by 4 (len % 4 = 0).
The second is that the FourierTransform.FFT() method throws an "Index out of range exception". I've been debubbing it and i found that in line 69
tr = xre[k + n2] * c + xim[k + n2] * s;
"k + n2" is absolutely out of range, about 100 positions over the limit.
Is there any bug or is not posible to plot frequencies under 11025Hz?
Note: i am plotting using:
public void init()
{
oAudioFrame = new AudioFrame(false);
oAudioFrame.IsDetectingEvents = true;
oAudioFrame.AmplitudeThreshold = 16384;
}
public void Plot()
{
oAudioFrame.Process(ref sound_data);
oAudioFrame.RenderTimeDomainRight(ref pb1);
}
|
|
|
|

|
I receive this in the status window when running the source code in Vista 64-bit:
4/22/2009 4:44:10 PM : Audio input device detected
4/22/2009 4:44:10 PM : Audio input device polling stopped
When I run the executable, I get an unhandled exception and it does the same as the source if I continue:
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at SoundCatcher.FormMain.Start()
at SoundCatcher.FormMain.FormMain_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3074 (QFE.050727-3000)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
SoundCatcher
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/David/Documents/SoundCatcher/SoundCatcher.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3074 (QFE.050727-3000)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Any ideas?
|
|
|
|

|
I'm not sure about this but I suspect there's a problem with your frequency spectrum. I've set your 'test' flag to true so that it works on a simple sine wave and the spectrum shows a dominant frequency with side content indicating the presence of other frequencies which simply aren't there. You should see a _single_ spike in the spectrum corresponding to the frequency of the sine wave being transformed. Otherwise, great job
|
|
|
|

|
Hi, Mr. Morton!
My groupmates and I have a project in which we aim to get the the person's voice frequency so that we could tell his/her vocal range (i.e. Soprano, Alto, Bass, Tenor). We are very interested in your project here, and we would like to utilize some of your techniques. We were just wondering how we could get the frequencies. Instead of displaying it on the screen, how could we get the frequencies of the voice each second and could we possibly put the values in an array or arraylist? If so, could you help us locate the specific part of your code that could help us accomplish this?
Thank you for your time, and I hope for your reply
|
|
|
|

|
Hi all,
this is a question similar to the previous:
anybody knows how can we change the audioin device from microphone to an existing wav file so we can plot the spectrogram of this file and ignore any input from the microphone?
I've played around with the FormMain.cs line
"_recorder = new WaveInRecorder(Properties.Settings.Default.SettingAudioInputDevice, _waveFormat, Properties.Settings.Default.SettingBytesPerFrame * Properties.Settings.Default.SettingChannels, 3, new BufferDoneEventHandler(DataArrived));"
and tried to change the "Properties.Settings.Default.SettingAudioInputDevice" to an integer but didn't work. I guess is not that simple.
Thanks for a great code
plouvou
|
|
|
|

|
Hi,
I am doing project in C# . in which I have to draw waveform for existing .wav file and also explain if wave file have 2 channels
and also I have to edit that generated wave
how can i do this anybody can help plz
Thanks,
gauri
|
|
|
|

|
Jeff
Very great application. And thanks for sharing the code.
Here's my one point:
Try right click or left click on the window when it's running, you'll observe drawing delay.
That's because the events raised by the timers are in the same thread of UI.
You can use System.Timers.Timer to eliminate this delay, but graphic object need to be locked to avoid multithread issues.
|
|
|
|

|
Hi!
Lines 67 and 71 in the file AudioFrame.cs are both like this:
if (_waveLeft[h] > AmplitudeThreshold || _waveLeft[h] < -AmplitudeThreshold)
I assume that the line 71 should actually be like this:
if (_waveRight[h] > AmplitudeThreshold || _waveRight[h] < -AmplitudeThreshold)
Anyway, thanks for the useful article!
Atis
P.S. Below is the relevant fragment of the original code:
for (int i = 0; i < wave.Length; i += 4)
{
_waveLeft[h] = (double)BitConverter.ToInt16(wave, i);
if (IsDetectingEvents == true)
if (_waveLeft[h] > AmplitudeThreshold || _waveLeft[h] < -AmplitudeThreshold)
IsEventActive = true;
_waveRight[h] = (double)BitConverter.ToInt16(wave, i + 2);
if (IsDetectingEvents == true)
if (_waveLeft[h] > AmplitudeThreshold || _waveLeft[h] < -AmplitudeThreshold)
IsEventActive = true;
h++;
}
|
|
|
|
|

|
I'm an experienced and published telemarketing expert looking for a programmer as a partner. I'm interested in offering an anger detection service that would enable call centers to identify those calls involving angry customers.
Specifically, I need an application that can perform the following functions rapidly:
(1) automatically open one audio file after another
(2) analyze each file for mean pitch, maximum pitch variation, mean volume, maximum volume variation, and rate of speech
(3) Report the raw data in text format that can be downloaded into a Excel spreadsheet or other database
The programmer would receive 50% of gross revenue.
Are you interested in receiving a business proposal? Do you know someone else who might be?
Thanks you -
Stewart Rogers
Stewart@100000ColdCalls.com
|
|
|
|

|
If i speak some thing the wave are moving but the recorded one is not storing how it will work
Can you please help me on this
Ashok Nalam
|
|
|
|

|
Jeff,
This is a great example program. I would like to incorporate the actual frequencies that are being read along with the graph along the X-Axis.
I see after the fourier transform, your member variables _fftLeft and _fftRight contain 2048 values containing the amplitudes. How can I translate this to the appropriate actual frequencies?
I’m actually interesting in displaying just a few of the frequencies – for instance 2500.
I’m a newbie to DSP side of things, so any help or insight would be appreciated.
Thank you!
|
|
|
|

|
hello.. I'm a computer graphics student and i'm using your code to extract the main frequency of the microphone input.. but i need it to be really quick. another code of yours (Soundviewer) and it was giving 1 output per second.. this one is faster but still not fast enough (i'm not rendering anything right now so thats not the issue. I just can't find on both examples how to define the number of outputs per second
Thank you very much
Paulo Ricca
|
|
|
|

|
Congratulations for this project...
I have two questions about this.
1) How can I create wav recording file with the same during ?
I try with the parameter "SettingSecondsToSave" but it don't work
2) It is possible to separate sound stream (two streams from jack in sound card)
Thanks for yours answers.
DR
|
|
|
|

|
Solid looking code... I've been looking for a while for something like this incorporating FFTs with some real world applications written in C# (for us NON computer engineers). Thanks a lot for the contribution.
|
|
|
|

|
How can i take input sound from directly the sound card ?
I want to use the graph part of your project for my player. If it is possible ?
|
|
|
|

|
Have you considered using WPF? I've done a little messing around and it appears to be much faster at drawing things on the screen (due to the fact that it utilises DirectX and therefore hardware acceleration). Mind you I only testing it with scrolling around a few hundred thousand images quickly.
Perhaps you could split the code nicely and have a library and then WPF provides a UI demo above it?
Just a thought...
|
|
|
|

|
Hi, just tried opening the solution file using VS2005 - it complained it was made by a newer version and could not be opened. Opening just the project file is fine. It's not a problem, just thought I'd say.
Cheers for the great project!.
|
|
|
|
 |