|
|
Well, firstly you would need to decode the MP3 data. No point reinventing the wheel, just use something like LAME[^]
Then you need to draw it to the screen somehow. If you are using Windows, I might suggest GDI+[^]
The scope is the most basic audio analysis visual to make... all you are essentially doing is displaying the value of the data at each sample, so just draw it like a massive line graph mapping sample number vs. sample value
|
|
|
|
|
For the plotting part, there's a couple of chart controls on CP. You can also have a look at my sig for one of them that I developed.
|
|
|
|
|
Hi,
I deveopled a MFC appliocation using visual studio 2008. It is running fine on double clicking the exe but If I launch the same application using installer (install shield) it is not lanching and producing a exception.
What might be the cause?
|
|
|
|
|
Perhaps an exception code, minidump, memory snapshot, anything could help, attatch the visual studio debugger as a JIT debugger.
|
|
|
|
|
john5632 wrote: it is not lanching and producing a exception
What is the exception ?
modified on Wednesday, January 19, 2011 10:43 PM
|
|
|
|
|
As soon as IO try to launch the application using installer I get the below exception:
Problem Event Name: APPCRASH
Application Name: Myapp.exe
Application Version: 6.3.11.0
Application Timestamp: 4d343707
Fault Module Name: ntdll.dll
Fault Module Version: 6.1.7600.16385
Fault Module Timestamp: 4a5bdb3b
Exception Code: c0000005
Exception Offset: 00038c39
OS Version: 6.1.7600.2.0.0.256.48
Locale ID: 1033
Additional Information 1: 4c0d
Additional Information 2: 4c0d4d78887f76d971d5d00f1f20a433
Additional Information 3: 4c0d
Additional Information 4: 4c0d4d78887f76d971d5d00f1f20a433
|
|
|
|
|
Exception Code: c0000005 is a protection fault. You tried to read/write to a bad memory address. Although it says the error occurred in ntdll, it is most likely an argument you passed into a function in there.
Try attaching a debugger to the process when it is in the crashed state to see the call stack. At a rough guess I would say it is something to do with your command line processing
|
|
|
|
|
But If I run the application using clicking the exe, it is running and same exceptino is coming after quit the application.
But If I run application as Admin, It works fine.
What is the problem?
|
|
|
|
|
Then your code must do something that requires Admin rights (in the Cleanup) and you aren't handling the error properley.
There is a vast number of things that this could be, but there is a fair chance that it is with a file. The Program Files and Windows directory are protected if UAC is enabled (Win Vista/7).
For example, if you open a file in a protected location and try to read it without checking that it is open you may be using invalid data.
|
|
|
|
|
May be you will have to install the VC++ 2008 redistributable as well.
|
|
|
|
|
Although some people define "crash" rather generally, if it was missing the runtimes it would generally show a message saying something like "the application failed to initialize. The application configuration is incorrect"
|
|
|
|
|
That's mean it doesn't work on another machine?
If the answer is yes then you probably have to deploy VC runtime and/or MFC DLL (see, for instance, http://msdn.microsoft.com/en-us/library/8kche8ah(VS.90).aspx[^]).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
In addition to what others suggested, please make sure all the dependent files ( lib and dll) are located by your installer app.
Hope this helps
|
|
|
|
|
Hi all,
How can i get this below string.
For example:
I want to pass string as phone+="984512345".
I am trying with below code.
CString str = "phone+=";
str += "984512345";
Output:str = phone+=984512345.
I am not getting that "984512345".
How can i add " to that string
Thanks
Raj
|
|
|
|
|
If I well understood, you want the " into the final string.
Try
CString str = "phone+=";
str += "\"984512345\"";
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
Hi All.
A very simple question, but so far not able to find any concrete solution.
I just want to round a decimal value to a provided decimal place.
I have found few functions to do the same, but they also fail for some double values...like...
double Round1(double dbVal, int nPlaces)
{
const double dbShift = pow(10.0, nPlaces);
return floor(dbVal * dbShift + 0.5) / dbShift;
}
double Round2(double value,int pos)
{
double returnValue;
double tens = exp(pos*log(10.0));
if((value - floor(value*tens)/tens)*tens >= 0.5)
returnValue = ceil(value*tens)/tens
else
returnValue = floor(value*tens)/tens;
return returnValue;
}
Both of above function fails in case the double value is
10430.889999999999
464.45999999999998
3294.5100000000002
Please suggest.
Thanks
PanB
|
|
|
|
|
I haven't looks at Round2, but cannot imagine a case where you would need to use exp and log to round.
|
|
|
|
|
Is it a possibility for you to convert this to CString (if using MFC) or char* (using sprintf_s)?
If affirmative, use the format specifiers and call API CString::Format or sprintf_s and then convert back to double value when returning from your function.
I am a HUMAN. I have that keyword in my name........
_AnsHUMAN_
|
|
|
|
|
Converting double to CString can be done, but to round off the same will take lots of permutations and combinations because we dont know upto what decimal place we need rounding.
If I am wrong then please let me know, and in case you have some pointers then do let me know that as well.
Thanks
PanB
|
|
|
|
|
That's still won't solve the problem, you would still be limited by floating point precision.
|
|
|
|
|
Have a look here[^] to see how a double variable is stored in memory.
You miss a ';' in your Round2 function, but otherwise the rounding functions are fine. 64 bits just isn't accurate enough to store the numbers you need.
modified 13-Sep-18 21:01pm.
|
|
|
|
|
You won't be able to do something like that due to the nature of floating points. I suggest you google for floating point precision for more information about the subject (e.g. on wikipedia[^]).
The good news is that you most probably don't have to care about it. Why do you need to be precise like that ? Most of the time a such a precision error is perfectly acceptable.
|
|
|
|
|
You cannot alter the precision of floating point numbers this way. Your rounding should occur when you wish to display the number as a string. A Google search for "floating point value" will find lots of papers that explain why this is so.
I must get a clever new signature for 2011.
|
|
|
|
|
I used convolution operation to measure performance of the 2 configurations on 64 bit OS.
Inner Product Experiment: CPU, FPU vs. SSE*[^]
x64 x86
chars processing time: 10 ms 20 ms
shorts processing time: 12 ms 23 ms
shorts sse2 processing time: 6 ms 6 ms
ints processing time: 14 ms 20 ms
floats processing time: 18 ms 50 ms
sse2 set processing time: 14 ms 15 ms
sse2 intrin processing time: 12 ms 12 ms
sse3 assembly processing time: N/A 13 ms
doubles processing time: 26 ms 25 ms
doubles sse2 processing time: 25 ms 24 ms
As can be seen there is no difference in SSE optimization but chars, shorts, ints and floats runs faster.
Especially floats runs as fast or SSE optimization.
But doubles do not show any difference.
Why there is no difference in SSE and double operations?
Чесноков
|
|
|
|