Mastersam
Messages postés116Date d'inscriptiondimanche 26 septembre 2004StatutMembreDernière intervention13 février 2008
-
13 oct. 2004 à 20:12
Mastersam
Messages postés116Date d'inscriptiondimanche 26 septembre 2004StatutMembreDernière intervention13 février 2008
-
19 oct. 2004 à 20:40
Bonjour je voudrais creer une application permettant d'analyser le flux audio sortant de la carte son, en ayant choisi le périphérique de capture et le canal d'enregistrement (entrée lign, master, cd , micro...).
Pour l'analyse je voudrais juste savoir comment récupérer 1 à 1 les samples sortant.
Je travaille sous devcpp en C# ( pas en cpp) donc j'ai bien vu plusieurs sources sur le site mais tout est bien trop compliqué par rapport à ce que je veux faire.
Le but final est de creer en module qui capture et trace la forme du signal sortant (sans le sauvegarder) et qui sache déterminer le tempo s'il existe du flux audio sélectionné. mais ma première question n'est pas si large, je veux juste connaitre le point de départ.
Mastersam
Messages postés116Date d'inscriptiondimanche 26 septembre 2004StatutMembreDernière intervention13 février 2008 19 oct. 2004 à 08:00
Bon pour le bitblt c'est bon j'ai trouvé j'avais pas créé de bitmap pour dessiner, ça s'affiche mais ça plante encore plus vite qu'avant c'est vraiment bizarre.
case WM_PAINT:
{
HDC hdc;
HDC hdcMemory;
HBITMAP hMemBmp;
PAINTSTRUCT ps;
HPEN hp; // Scope
HBRUSH hb; // Fond du scope
LOGBRUSH lb; // Style de la brush
short xScale, yScale; // Pour les differentes echelles
// Pour les boucles et les indices
// On met a l'echelle de la fenetre
rect.left = 0;
rect.top = 0;
rect.right = 310;
rect.bottom = 67;
// Structure pour la brush
lb.lbStyle = BS_SOLID;
lb.lbColor = 0x00000000;
// On recupere le DC de la fenetre
hdc = BeginPaint(hwnd, &ps);
// Creation de PEN et de BRUSH
hp = CreatePen(PS_SOLID, 1, 0x0000FF00);
hb = CreateBrushIndirect(&lb);
hdcMemory=CreateCompatibleDC(NULL);
hMemBmp = CreateCompatibleBitmap(hdc, 310, 67);
// On les selectionne
SelectObject(hdcMemory, hMemBmp);
SelectObject(hdcMemory, hp);
SelectObject(hdcMemory, hb);
// On dessine le fond du scope
Rectangle(hdcMemory, rect.left, rect.top, rect.right, rect.bottom);
for(i=1; i<310; i++)
{
MoveToEx(hdcMemory, i,rect.bottom-(6*beat[i]), NULL);
LineTo(hdcMemory, i,rect.bottom-7-(sound[i]/(max/60)));
}
hp = CreatePen(PS_SOLID, 1, 0x00FF0000);
SelectObject(hdc, hp);
if(moyenne<max)
{
MoveToEx(hdcMemory, 0,rect.bottom-7-moyenne/(max/60), NULL);
LineTo(hdcMemory, 310,rect.bottom-7-moyenne/(max/60));
}
hp = CreatePen(PS_SOLID, 1, 0x0055FFFF);
SelectObject(hdc, hp);
if(moyenne+limithi<max)
{
MoveToEx(hdcMemory, 0,rect.bottom-7-(moyenne+limithi)/(max/60), NULL);
LineTo(hdcMemory, 310,rect.bottom-7-(moyenne+limithi)/(max/60));
}
if(moyenne+limitlow<max)
{
MoveToEx(hdcMemory, 0,rect.bottom-7-(min)/(max/60), NULL);
LineTo(hdcMemory, 310,rect.bottom-7-(min)/(max/60));
}
// Fin du dessin
BitBlt(hdc,0,0,rect.right,rect.bottom,hdcMemory,0,0,SRCCOPY);
Mastersam
Messages postés116Date d'inscriptiondimanche 26 septembre 2004StatutMembreDernière intervention13 février 2008 19 oct. 2004 à 08:00
Bon pour le bitblt c'est bon j'ai trouvé j'avais pas créé de bitmap pour dessiner, ça s'affiche mais ça plante encore plus vite qu'avant c'est vraiment bizarre.
case WM_PAINT:
{
HDC hdc;
HDC hdcMemory;
HBITMAP hMemBmp;
PAINTSTRUCT ps;
HPEN hp; // Scope
HBRUSH hb; // Fond du scope
LOGBRUSH lb; // Style de la brush
short xScale, yScale; // Pour les differentes echelles
// Pour les boucles et les indices
// On met a l'echelle de la fenetre
rect.left = 0;
rect.top = 0;
rect.right = 310;
rect.bottom = 67;
// Structure pour la brush
lb.lbStyle = BS_SOLID;
lb.lbColor = 0x00000000;
// On recupere le DC de la fenetre
hdc = BeginPaint(hwnd, &ps);
// Creation de PEN et de BRUSH
hp = CreatePen(PS_SOLID, 1, 0x0000FF00);
hb = CreateBrushIndirect(&lb);
hdcMemory=CreateCompatibleDC(NULL);
hMemBmp = CreateCompatibleBitmap(hdc, 310, 67);
// On les selectionne
SelectObject(hdcMemory, hMemBmp);
SelectObject(hdcMemory, hp);
SelectObject(hdcMemory, hb);
// On dessine le fond du scope
Rectangle(hdcMemory, rect.left, rect.top, rect.right, rect.bottom);
for(i=1; i<310; i++)
{
MoveToEx(hdcMemory, i,rect.bottom-(6*beat[i]), NULL);
LineTo(hdcMemory, i,rect.bottom-7-(sound[i]/(max/60)));
}
hp = CreatePen(PS_SOLID, 1, 0x00FF0000);
SelectObject(hdc, hp);
if(moyenne<max)
{
MoveToEx(hdcMemory, 0,rect.bottom-7-moyenne/(max/60), NULL);
LineTo(hdcMemory, 310,rect.bottom-7-moyenne/(max/60));
}
hp = CreatePen(PS_SOLID, 1, 0x0055FFFF);
SelectObject(hdc, hp);
if(moyenne+limithi<max)
{
MoveToEx(hdcMemory, 0,rect.bottom-7-(moyenne+limithi)/(max/60), NULL);
LineTo(hdcMemory, 310,rect.bottom-7-(moyenne+limithi)/(max/60));
}
if(moyenne+limitlow<max)
{
MoveToEx(hdcMemory, 0,rect.bottom-7-(min)/(max/60), NULL);
LineTo(hdcMemory, 310,rect.bottom-7-(min)/(max/60));
}
// Fin du dessin
BitBlt(hdc,0,0,rect.right,rect.bottom,hdcMemory,0,0,SRCCOPY);
Mastersam
Messages postés116Date d'inscriptiondimanche 26 septembre 2004StatutMembreDernière intervention13 février 2008 19 oct. 2004 à 20:27
Bon je viens d'essayer en créant un hdc global static pour éviter d'en créer à chaque fois entre 25 et 30 par seconde.... Et ben ça plante toujours. Et en plus même avec le double buffering ça clignote encore.
Je désespère franchement.... je sais plus quoi essayer.