1
Audio / Re: FFT on audio samples
« on: May 28, 2012, 08:24:41 pm »
Thanks for the reply. I'm trying to come up with a method to convert data into FFTW's format.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
'GraphicTest.exe': Loaded 'C:\Users\admin\Documents\Visual Studio 2008\Projects\GraphicTest\Debug\GraphicTest.exe', Symbols loaded.
'GraphicTest.exe': Loaded 'C:\Windows\System32\ntdll.dll'
'GraphicTest.exe': Loaded 'C:\Windows\System32\kernel32.dll'
'GraphicTest.exe': Loaded 'C:\Windows\System32\KernelBase.dll'
'GraphicTest.exe': Loaded 'C:\Windows\System32\opengl32.dll'
'GraphicTest.exe': Loaded 'C:\Windows\System32\msvcrt.dll'
'GraphicTest.exe': Loaded 'C:\Windows\System32\advapi32.dll'
'GraphicTest.exe': Loaded 'C:\Windows\System32\sechost.dll'
'GraphicTest.exe': Loaded 'C:\Windows\System32\rpcrt4.dll'
'GraphicTest.exe': Loaded 'C:\Windows\System32\gdi32.dll'
'GraphicTest.exe': Loaded 'C:\Windows\System32\user32.dll'
'GraphicTest.exe': Loaded 'C:\Windows\System32\lpk.dll'
'GraphicTest.exe': Loaded 'C:\Windows\System32\usp10.dll'
'GraphicTest.exe': Loaded 'C:\Windows\System32\glu32.dll'
'GraphicTest.exe': Loaded 'C:\Windows\System32\ddraw.dll'
'GraphicTest.exe': Loaded 'C:\Windows\System32\dciman32.dll'
'GraphicTest.exe': Loaded 'C:\Windows\System32\setupapi.dll'
'GraphicTest.exe': Loaded 'C:\Windows\System32\cfgmgr32.dll'
'GraphicTest.exe': Loaded 'C:\Windows\System32\oleaut32.dll'
'GraphicTest.exe': Loaded 'C:\Windows\System32\ole32.dll'
'GraphicTest.exe': Loaded 'C:\Windows\System32\devobj.dll'
'GraphicTest.exe': Loaded 'C:\Windows\System32\dwmapi.dll'
'GraphicTest.exe': Loaded 'C:\Windows\System32\winmm.dll'
'GraphicTest.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.21022.8_none_96748342450f6aa2\msvcp90d.dll', Symbols loaded.
'GraphicTest.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.21022.8_none_96748342450f6aa2\msvcr90d.dll', Symbols loaded.
'GraphicTest.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4926_none_508ed732bcbc0e5a\msvcr90.dll'
'GraphicTest.exe': Loaded 'C:\Windows\System32\imm32.dll'
'GraphicTest.exe': Loaded 'C:\Windows\System32\msctf.dll'
'GraphicTest.exe': Loaded 'C:\Windows\System32\uxtheme.dll'
'GraphicTest.exe': Loaded 'C:\Windows\System32\prl_gldd.dll'
'GraphicTest.exe': Loaded 'C:\Windows\System32\version.dll'
'GraphicTest.exe': Loaded 'C:\Windows\System32\cryptbase.dll'
'GraphicTest.exe': Loaded 'C:\Windows\System32\dinput.dll'
'GraphicTest.exe': Loaded 'C:\Windows\System32\hid.dll'
'GraphicTest.exe': Loaded 'C:\Windows\System32\wintrust.dll'
'GraphicTest.exe': Loaded 'C:\Windows\System32\crypt32.dll'
'GraphicTest.exe': Loaded 'C:\Windows\System32\msasn1.dll'
First-chance exception at 0x0100a800 in GraphicTest.exe: 0xC0000005: Access violation.
A buffer overrun has occurred in GraphicTest.exe which has corrupted the program's internal state. Press Break to debug the program or Continue to terminate the program.
For more details please see Help topic 'How to debug Buffer Overrun Issues'.
The program '[3236] GraphicTest.exe: Native' has exited with code 0 (0x0).
'SFMLTest.exe': Loaded 'C:\Users\user\Documents\Visual Studio 2008\Projects\SFMLTest\Release\SFMLTest.exe', Symbols loaded.
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll'
'SFMLTest.exe': Loaded 'C:\Users\user\Documents\Visual Studio 2008\Projects\SFMLTest\Release\sfml-system.dll'
'SFMLTest.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50934f2ebcb7eb57\msvcp90.dll'
'SFMLTest.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50934f2ebcb7eb57\msvcr90.dll'
'SFMLTest.exe': Loaded 'C:\Users\user\Documents\Visual Studio 2008\Projects\SFMLTest\Release\sfml-audio.dll'
'SFMLTest.exe': Loaded 'C:\Users\user\Documents\Visual Studio 2008\Projects\SFMLTest\Release\openal32.dll', Binary was not built with debug information.
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\user32.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\winmm.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\dsound.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\powrprof.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\setupapi.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\oleaut32.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\devobj.dll'
'SFMLTest.exe': Loaded 'C:\Users\user\Documents\Visual Studio 2008\Projects\SFMLTest\Release\libsndfile-1.dll', Binary was not built with debug information.
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\clbcatq.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\MMDevAPI.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\propsys.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\shlwapi.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\wdmaud.drv'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\ksuser.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\avrt.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\AudioSes.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\msacm32.drv'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\msacm32.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\midimap.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\uxtheme.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\dwmapi.dll'
The thread 'Win32 Thread' (0xd88) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0xbe4) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x544) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x193c) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x14c0) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0xb6c) has exited with code 1 (0x1).
The thread 'Win32 Thread' (0xa34) has exited with code 1 (0x1).
The thread 'Win32 Thread' (0xfe0) has exited with code 1 (0x1).
The thread 'Win32 Thread' (0x1578) has exited with code 1 (0x1).
The thread 'Win32 Thread' (0x1460) has exited with code 1 (0x1).
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\wintrust.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\crypt32.dll'
'SFMLTest.exe': Loaded 'C:\Windows\SysWOW64\msasn1.dll'
The program '[6548] SFMLTest.exe: Native' has exited with code 1 (0x1).
Whatever you connect to the microphone input of your sound card, SFML will provide it as audio samples. Then it's up to you to interpret them the way you want, for example running a FFT on it if you want to extract the frequencies.
What kind of input does your audio card allow that's not an audio signal? :shock:
If you want to deal with audioinput check out the sf::SoundRecorder class.
QuoteBut I have disabled firewalls and done the port forwarding as well. Any idea to get it working with the public addresses?
Nop, nothing more than what you already did, sorry. That should be enough.
QuoteCode: [Select]sf::IPAddress Address1("112.134.72.168");
That's what I expected
You're using your public IP, which means that the communication goes through the internet and is probably blocked by your router.
Use either your local network address (192.168.xxx.xxx) or localhost (127.0.0.1).
Could you slightly modify this code, and use a fixed IP address instead of one that is entered by user? It's easier to debug/test for us, and see if you're using a bad address for exampleQuoteThe receiving program did not produce any response
Not even an error?
#include <SFML/Network.hpp>
#include <iostream>
#include <string>
using namespace std;
void sendMsg ()
{
char msg[] = "Testing message only.";
sf::IPAddress Address1("112.134.72.168");
sf::SocketUDP Socket;
if (Socket.Send(msg, sizeof(msg), Address1, 4568) != sf::Socket::Done)
{
cout << "Error sending...\n";
}
}
void getMsg ()
{
sf::SocketUDP Socket;
if (!Socket.Bind(4568))
{
cout << "Error binding...\n";
}
char Buffer[128];
std::size_t Received;
sf::IPAddress Sender;
unsigned short Port;
if (Socket.Receive(Buffer, sizeof(Buffer), Received, Sender, Port) != sf::Socket::Done)
{
cout << "Error receiving message...\n";
}
cout << Sender << ":" << Port <<endl;
cout << Buffer <<endl;
}
void main ()
{
char ch;
cout << "Send message (S), Get message (G) : ";
cin >> ch;
if (ch == 'S' || ch == 's')
{
sendMsg();
}
else if (ch == 'G' || ch == 'g')
{
getMsg();
}
system ("PAUSE");
}
Yes it is possible.
If you want us to find out what's wrong in your code, show it
#include <SFML/Network.hpp>
#include <iostream>
#include <string>
using namespace std;
void sendMsg ()
{
string ip = " ";
char msg[] = "Testing message only.";
cout << "Enter the IP address to send the message : ";
cin >> ip;
sf::IPAddress Address1(ip);
sf::SocketUDP Socket;
if (Socket.Send(msg, sizeof(msg), ip, 4567) != sf::Socket::Done)
{
cout << "Error sending...\n";
}
}
void getMsg ()
{
sf::SocketUDP Socket;
if (!Socket.Bind(4567))
{
cout << "Error binding...\n";
}
char Buffer[128];
std::size_t Received;
sf::IPAddress Sender;
unsigned short Port;
if (Socket.Receive(Buffer, sizeof(Buffer), Received, Sender, Port) != sf::Socket::Done)
{
cout << "Error receiving message...\n";
}
cout << Sender << ":" << Port <<endl;
cout << Buffer <<endl;
}
void main ()
{
char ch;
cout << "Send message (S), Get message (G) : ";
cin >> ch;
if (ch == 'S' || ch == 's')
{
sendMsg();
}
else if (ch == 'G' || ch == 'g')
{
getMsg();
}
system ("PAUSE");
}
You don't see the console because you created a GUI application (which is the reason why you need a WinMain entry point instead of a main).
You must change your project to be a console application.
You must link to sfml-main.