begin process at 2012 05 27 16:32:16
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Multimédia

 > GÉNÉRATEUR DE FICHIER WAV DE RÉFÉRENCE POUR CD DE TEST

GÉNÉRATEUR DE FICHIER WAV DE RÉFÉRENCE POUR CD DE TEST


 Information sur la source

Note :
9 / 10 - par 1 personne
9,00 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :Multimédia Classé sous :creation, riff, fichier, wav, génerer Niveau :Débutant Date de création :24/10/2005 Date de mise à jour :03/03/2007 00:39:47 Vu / téléchargé :10 129 / 517

Auteur : gabuzomeuh

Ecrire un message privé
Commentaire sur cette source (5)
Ajouter un commentaire et/ou une note

 Description

Cliquez pour voir la capture en taille normale
Ce code sert à fabriquer un fichier wav pour etre écouté ou gravé sur CD.
On peut régler la fréquence d'énchantillonnage, les amplitudes en % ou en dB, les fréquences séparément pour la voie droite ou gauche

Source

  • #include <windows.h>
  • #include "stdafx.h"
  • #include "resource.h"
  • #include <stdio.h>
  • #include <commdlg.h>
  • #include <math.h>
  • #include <mmsystem.h>
  • //****************************************************************************
  • BOOL CALLBACK DlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
  • {
  • static char txt[64];
  • static char pathname[256];
  • static int status;
  • static int i,j;
  • static int FE[6];
  • static int duree[6];
  • static int frequenceG[19981], frequenceD[19981], frequence[19981];
  • static int gainG[121], gainD[121], gain[121];
  • static int canaux[2];
  • static int octets[2];
  • FILE *fichier;
  • static double pi=3.1415926535897932;
  • static short val;
  • static unsigned long pointeur=0;
  • static unsigned long longueur=0;
  • static unsigned char bloc[4];
  • static char en_tete[44]={0x52,0x49,0x46,0x46, // "RIFF"
  • 0x00,0x00,0x00,0x00, // Taille du fichier moins 8 octets
  • 0x57,0x41,0x56,0x45, // "WAVE"
  • 0x66,0x6d,0x74,0x20, // "fmt "
  • 0x10,0x00,0x00,0x00,
  • 0x01,0x00, // 1 pour PCM
  • 0x02,0x00, // 1 pour mono, 2 pour stereo
  • 0x44,0xAC,0x00,0x00, // frequence d'echantillonnage AC44h = 44100
  • 0x10,0xb1,0x02,0x00, // Nombre d'octets par seconde de musique
  • 0x04,0x00, // Nombre d'octets par échantillon
  • 0x10,0x00, // Nombre de bits par donnée
  • 0x64,0x61,0x74,0x61, // Constante "data"
  • 0x00,0x00,0x00,0x00}; // Taille du file_handle moins 116 octets
  • if (msg == WM_INITDIALOG)
  • {
  • ShowWindow(GetDlgItem(hWnd,IDC_COMBO_frequence),SW_HIDE);
  • ShowWindow(GetDlgItem(hWnd,IDC_COMBO_gain),SW_HIDE);
  • SetDlgItemText(hWnd,IDC_STATIC1," ");
  • SendDlgItemMessage(hWnd, IDC_EDIT_CHEMIN, EM_LIMITTEXT, 200, 0);
  • sprintf(txt,"48000");
  • FE[0] = 48000;
  • SendDlgItemMessage(hWnd, IDC_COMBO_FE , CB_ADDSTRING , 0 , (LPARAM)txt);
  • sprintf(txt,"44100");
  • FE[1] = 44100;
  • SendDlgItemMessage(hWnd, IDC_COMBO_FE , CB_ADDSTRING , 0 , (LPARAM)txt);
  • sprintf(txt,"32000");
  • FE[2] = 32000;
  • SendDlgItemMessage(hWnd, IDC_COMBO_FE , CB_ADDSTRING , 0 , (LPARAM)txt);
  • sprintf(txt,"22050");
  • FE[3] = 22050;
  • SendDlgItemMessage(hWnd, IDC_COMBO_FE , CB_ADDSTRING , 0 , (LPARAM)txt);
  • sprintf(txt,"11025");
  • FE[4] = 11025;
  • SendDlgItemMessage(hWnd, IDC_COMBO_FE , CB_ADDSTRING , 0 , (LPARAM)txt);
  • sprintf(txt,"8000");
  • FE[5] = 8000;
  • SendDlgItemMessage(hWnd, IDC_COMBO_FE , CB_ADDSTRING , 0 , (LPARAM)txt);
  • SendDlgItemMessage(hWnd, IDC_COMBO_FE , CB_SETCURSEL , 1 , 0);
  • sprintf(txt,"100 ms");
  • duree[0] = 100;
  • SendDlgItemMessage(hWnd, IDC_COMBO_duree , CB_ADDSTRING , 0 , (LPARAM)txt);
  • sprintf(txt,"200 ms");
  • duree[1] = 200;
  • SendDlgItemMessage(hWnd, IDC_COMBO_duree , CB_ADDSTRING , 0 , (LPARAM)txt);
  • sprintf(txt,"500 ms");
  • duree[2] = 500;
  • SendDlgItemMessage(hWnd, IDC_COMBO_duree , CB_ADDSTRING , 0 , (LPARAM)txt);
  • sprintf(txt,"1000 ms");
  • duree[3] = 1000;
  • SendDlgItemMessage(hWnd, IDC_COMBO_duree , CB_ADDSTRING , 0 , (LPARAM)txt);
  • sprintf(txt,"2000 ms");
  • duree[4] = 2000;
  • SendDlgItemMessage(hWnd, IDC_COMBO_duree , CB_ADDSTRING , 0 , (LPARAM)txt);
  • sprintf(txt,"5000 ms");
  • duree[5] = 5000;
  • SendDlgItemMessage(hWnd, IDC_COMBO_duree , CB_ADDSTRING , 0 , (LPARAM)txt);
  • SendDlgItemMessage(hWnd, IDC_COMBO_duree , CB_SETCURSEL , 3 , 0);
  • sprintf(txt,"mono");
  • canaux[0] = 1;
  • SendDlgItemMessage(hWnd, IDC_COMBO_canaux , CB_ADDSTRING , 0 , (LPARAM)txt);
  • sprintf(txt,"stereo");
  • canaux[1] = 2;
  • SendDlgItemMessage(hWnd, IDC_COMBO_canaux , CB_ADDSTRING , 0 , (LPARAM)txt);
  • SendDlgItemMessage(hWnd, IDC_COMBO_canaux , CB_SETCURSEL , 1 , 0);
  • sprintf(txt,"8 bit");
  • octets[0] = 1;
  • SendDlgItemMessage(hWnd, IDC_COMBO_octets , CB_ADDSTRING , 0 , (LPARAM)txt);
  • sprintf(txt,"16 bit");
  • octets[1] = 2;
  • SendDlgItemMessage(hWnd, IDC_COMBO_octets , CB_ADDSTRING , 0 , (LPARAM)txt);
  • SendDlgItemMessage(hWnd, IDC_COMBO_octets , CB_SETCURSEL , 1 , 0);
  • for(i=0; i<19981; i++)
  • {
  • sprintf(txt,"%d Hz",i+20);
  • frequenceG[i] = frequenceD[i] = frequence[i] = i;
  • SendDlgItemMessage(hWnd, IDC_COMBO_frequenceG , CB_ADDSTRING , 0 , (LPARAM)txt);
  • SendDlgItemMessage(hWnd, IDC_COMBO_frequenceD , CB_ADDSTRING , 0 , (LPARAM)txt);
  • SendDlgItemMessage(hWnd, IDC_COMBO_frequence , CB_ADDSTRING , 0 , (LPARAM)txt);
  • }
  • SendDlgItemMessage(hWnd, IDC_COMBO_frequenceG , CB_SETCURSEL , 420 , 0);
  • SendDlgItemMessage(hWnd, IDC_COMBO_frequenceD , CB_SETCURSEL , 420 , 0);
  • SendDlgItemMessage(hWnd, IDC_COMBO_frequence , CB_SETCURSEL , 420 , 0);
  • j = 0;
  • for(i=0; i<121; i++)
  • {
  • sprintf(txt,"%d dB",j);
  • gainG[i] = gainD[i] = gain[i] = j;
  • SendDlgItemMessage(hWnd, IDC_COMBO_gainG , CB_ADDSTRING , 0 , (LPARAM)txt);
  • SendDlgItemMessage(hWnd, IDC_COMBO_gainD , CB_ADDSTRING , 0 , (LPARAM)txt);
  • SendDlgItemMessage(hWnd, IDC_COMBO_gain , CB_ADDSTRING , 0 , (LPARAM)txt);
  • j--;
  • }
  • SendDlgItemMessage(hWnd, IDC_COMBO_gainG , CB_SETCURSEL , 0 , 0);
  • SendDlgItemMessage(hWnd, IDC_COMBO_gainD , CB_SETCURSEL , 0 , 0);
  • SendDlgItemMessage(hWnd, IDC_COMBO_gain , CB_SETCURSEL , 0 , 0);
  • return 0;
  • }
  • if (msg == WM_COMMAND)
  • {
  • if ((LOWORD(wParam)) == IDC_COMBO_canaux)
  • {
  • if (SendDlgItemMessage(hWnd, IDC_COMBO_canaux, CB_GETCURSEL , 0 , 0) == 0) // mono
  • {
  • ShowWindow(GetDlgItem(hWnd,IDC_COMBO_frequence),SW_SHOW);
  • ShowWindow(GetDlgItem(hWnd,IDC_COMBO_gain),SW_SHOW);
  • ShowWindow(GetDlgItem(hWnd,IDC_STATIC_G),SW_HIDE);
  • ShowWindow(GetDlgItem(hWnd,IDC_STATIC_D),SW_HIDE);
  • ShowWindow(GetDlgItem(hWnd,IDC_COMBO_frequenceG),SW_HIDE);
  • ShowWindow(GetDlgItem(hWnd,IDC_COMBO_frequenceD),SW_HIDE);
  • ShowWindow(GetDlgItem(hWnd,IDC_COMBO_gainG),SW_HIDE);
  • ShowWindow(GetDlgItem(hWnd,IDC_COMBO_gainD),SW_HIDE);
  • return 0;
  • }
  • if (SendDlgItemMessage(hWnd, IDC_COMBO_canaux, CB_GETCURSEL , 0 , 0) == 1) // stereo
  • {
  • ShowWindow(GetDlgItem(hWnd,IDC_COMBO_frequence),SW_HIDE);
  • ShowWindow(GetDlgItem(hWnd,IDC_COMBO_gain),SW_HIDE);
  • ShowWindow(GetDlgItem(hWnd,IDC_STATIC_G),SW_SHOW);
  • ShowWindow(GetDlgItem(hWnd,IDC_STATIC_D),SW_SHOW);
  • ShowWindow(GetDlgItem(hWnd,IDC_COMBO_frequenceG),SW_SHOW);
  • ShowWindow(GetDlgItem(hWnd,IDC_COMBO_frequenceD),SW_SHOW);
  • ShowWindow(GetDlgItem(hWnd,IDC_COMBO_gainG),SW_SHOW);
  • ShowWindow(GetDlgItem(hWnd,IDC_COMBO_gainD),SW_SHOW);
  • return 0;
  • }
  • return 0;
  • }
  • if (wParam == IDOK)
  • {
  • return 0;
  • }
  • if (wParam == IDCANCEL)
  • {
  • EndDialog(hWnd, 0);
  • return 0;
  • }
  • if (wParam == IDC_PLAY)
  • {
  • GetDlgItemText(hWnd, IDC_EDIT_CHEMIN,pathname,128);
  • if(strlen(pathname) == 0)
  • {
  • MessageBox(hWnd, "nom fichier vide !", "Makewav", MB_OK);
  • pathname[0]=0;
  • OPENFILENAME ofn;
  • memset( &ofn, 0, sizeof(OPENFILENAME) );
  • ofn.lStructSize = sizeof(OPENFILENAME);
  • ofn.hwndOwner = hWnd;
  • ofn.lpstrFilter = "Fichiers wave";
  • ofn.lpstrDefExt = "wav";
  • ofn.lpstrFile = pathname;
  • ofn.nMaxFile = 200;
  • ofn.lpstrTitle = "Sélectionnez un fichier";
  • ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_READONLY | OFN_EXTENSIONDIFFERENT | OFN_EXPLORER;
  • if(GetOpenFileName(&ofn))
  • {
  • SetDlgItemText(hWnd,IDC_EDIT_CHEMIN,pathname);
  • }
  • return 0;
  • }
  • PlaySound (pathname, NULL, SND_FILENAME | SND_ASYNC);
  • return 0;
  • }
  • if (wParam == IDC_FICHIER)
  • {
  • pathname[0]=0;
  • OPENFILENAME ofn;
  • memset( &ofn, 0, sizeof(OPENFILENAME) );
  • ofn.lStructSize = sizeof(OPENFILENAME);
  • ofn.hwndOwner = hWnd;
  • ofn.lpstrFilter = "Fichiers wave";
  • ofn.lpstrDefExt = "wav";
  • ofn.lpstrFile = pathname;
  • ofn.nMaxFile = 200;
  • ofn.lpstrTitle = "Sélectionnez un fichier";
  • ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_READONLY | OFN_EXTENSIONDIFFERENT | OFN_EXPLORER;
  • if(GetOpenFileName(&ofn))
  • {
  • SetDlgItemText(hWnd,IDC_EDIT_CHEMIN,pathname);
  • }
  • return 0;
  • }
  • if (wParam == IDC_WRITE)
  • {
  • GetDlgItemText(hWnd, IDC_EDIT_CHEMIN,pathname,128);
  • if(strlen(pathname) == 0)
  • {
  • MessageBox(hWnd, "nom fichier vide !", "Makewav", MB_OK);
  • pathname[0]=0;
  • OPENFILENAME ofn;
  • memset( &ofn, 0, sizeof(OPENFILENAME) );
  • ofn.lStructSize = sizeof(OPENFILENAME);
  • ofn.hwndOwner = hWnd;
  • ofn.lpstrFilter = "Fichiers wave";
  • ofn.lpstrDefExt = "wav";
  • ofn.lpstrFile = pathname;
  • ofn.nMaxFile = 200;
  • ofn.lpstrTitle = "Enregistrer sous";
  • ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_READONLY | OFN_EXTENSIONDIFFERENT | OFN_EXPLORER;
  • if(GetSaveFileName(&ofn))
  • {
  • SetDlgItemText(hWnd,IDC_EDIT_CHEMIN,pathname);
  • }
  • return 0;
  • }
  • fichier = fopen(pathname,"wb");
  • if (fichier == 0)
  • {
  • MessageBox(hWnd, "ouverture fichier impossible !", "Makewav", MB_OK);
  • return 0;
  • }
  • EnableWindow(GetDlgItem(hWnd,IDC_WRITE),FALSE);
  • SetDlgItemText(hWnd,IDC_STATIC1,"écriture...");
  • pointeur = 44;
  • fseek(fichier, pointeur, SEEK_SET);
  • for (i=0;i<(FE[SendDlgItemMessage(hWnd, IDC_COMBO_FE, CB_GETCURSEL , 0 , 0)]*duree[SendDlgItemMessage(hWnd, IDC_COMBO_duree, CB_GETCURSEL , 0 , 0)]*0.001);i++)
  • {
  • fseek(fichier, pointeur, SEEK_SET);
  • if ((SendDlgItemMessage(hWnd, IDC_COMBO_canaux, CB_GETCURSEL , 0 , 0) == 1) && (SendDlgItemMessage(hWnd, IDC_COMBO_octets, CB_GETCURSEL , 0 , 0) == 1))
  • // stereo 16 bit
  • {
  • val = pow(10, gainG[SendDlgItemMessage(hWnd, IDC_COMBO_gainG, CB_GETCURSEL , 0 , 0)]/20.0) * 32767 * sin(2*pi*frequenceG[SendDlgItemMessage(hWnd, IDC_COMBO_frequenceG, CB_GETCURSEL , 0 , 0)]*i/FE[SendDlgItemMessage(hWnd, IDC_COMBO_FE, CB_GETCURSEL , 0 , 0)]);
  • bloc[0] = (char)(val & 255);
  • bloc[1] = (char)(val >> 8);
  • val = pow(10, gainD[SendDlgItemMessage(hWnd, IDC_COMBO_gainD, CB_GETCURSEL , 0 , 0)]/20.0) * 32767 * sin(2*pi*frequenceD[SendDlgItemMessage(hWnd, IDC_COMBO_frequenceD, CB_GETCURSEL , 0 , 0)]*i/FE[SendDlgItemMessage(hWnd, IDC_COMBO_FE, CB_GETCURSEL , 0 , 0)]);
  • bloc[2] = (char)(val & 255);
  • bloc[3] = (char)(val >> 8);
  • }
  • if ((SendDlgItemMessage(hWnd, IDC_COMBO_canaux, CB_GETCURSEL , 0 , 0) == 0) && (SendDlgItemMessage(hWnd, IDC_COMBO_octets, CB_GETCURSEL , 0 , 0) == 1))
  • // mono 16 bit
  • {
  • val = pow(10, gain[SendDlgItemMessage(hWnd, IDC_COMBO_gain, CB_GETCURSEL , 0 , 0)]/20.0) * 32767 * sin(2*pi*frequence[SendDlgItemMessage(hWnd, IDC_COMBO_frequence, CB_GETCURSEL , 0 , 0)]*i/FE[SendDlgItemMessage(hWnd, IDC_COMBO_FE, CB_GETCURSEL , 0 , 0)]);
  • bloc[0] = (char)(val & 255);
  • bloc[1] = (char)(val >> 8);
  • }
  • if ((SendDlgItemMessage(hWnd, IDC_COMBO_canaux, CB_GETCURSEL , 0 , 0) == 0) && (SendDlgItemMessage(hWnd, IDC_COMBO_octets, CB_GETCURSEL , 0 , 0) == 0))
  • // mono 8 bit
  • {
  • val = pow(10, gain[SendDlgItemMessage(hWnd, IDC_COMBO_gain, CB_GETCURSEL , 0 , 0)]/20.0) * 127 * sin(2*pi*frequence[SendDlgItemMessage(hWnd, IDC_COMBO_frequence, CB_GETCURSEL , 0 , 0)]*i/FE[SendDlgItemMessage(hWnd, IDC_COMBO_FE, CB_GETCURSEL , 0 , 0)]);
  • bloc[0] = 127+(char)(val & 255);
  • }
  • if ((SendDlgItemMessage(hWnd, IDC_COMBO_canaux, CB_GETCURSEL , 0 , 0) == 1) && (SendDlgItemMessage(hWnd, IDC_COMBO_octets, CB_GETCURSEL , 0 , 0) == 0))
  • // stereo 8 bit
  • {
  • val = pow(10, gainG[SendDlgItemMessage(hWnd, IDC_COMBO_gainG, CB_GETCURSEL , 0 , 0)]/20.0) * 127 * sin(2*pi*frequenceG[SendDlgItemMessage(hWnd, IDC_COMBO_frequenceG, CB_GETCURSEL , 0 , 0)]*i/FE[SendDlgItemMessage(hWnd, IDC_COMBO_FE, CB_GETCURSEL , 0 , 0)]);
  • bloc[0] = 127+(char)(val & 255);
  • val = pow(10, gainD[SendDlgItemMessage(hWnd, IDC_COMBO_gainD, CB_GETCURSEL , 0 , 0)]/20.0) * 127 * sin(2*pi*frequenceD[SendDlgItemMessage(hWnd, IDC_COMBO_frequenceD, CB_GETCURSEL , 0 , 0)]*i/FE[SendDlgItemMessage(hWnd, IDC_COMBO_FE, CB_GETCURSEL , 0 , 0)]);
  • bloc[1] = 127+(char)(val & 255);
  • }
  • fwrite(bloc,(canaux[SendDlgItemMessage(hWnd, IDC_COMBO_canaux, CB_GETCURSEL , 0 , 0)]*octets[SendDlgItemMessage(hWnd, IDC_COMBO_octets, CB_GETCURSEL , 0 , 0)]),1,fichier);
  • pointeur=pointeur+(canaux[SendDlgItemMessage(hWnd, IDC_COMBO_canaux, CB_GETCURSEL , 0 , 0)]*octets[SendDlgItemMessage(hWnd, IDC_COMBO_octets, CB_GETCURSEL , 0 , 0)]);
  • }
  • fseek(fichier, 0L, SEEK_END);
  • longueur = ftell(fichier);
  • en_tete[0x04] = (char)((longueur-8) >> 0) & 255;
  • en_tete[0x05] = (char)((longueur-8) >> 8) & 255;
  • en_tete[0x06] = (char)((longueur-8) >> 16) & 255;
  • en_tete[0x07] = (char)((longueur-8) >> 24) & 255;
  • en_tete[0x16] = (char)(canaux[SendDlgItemMessage(hWnd, IDC_COMBO_canaux, CB_GETCURSEL , 0 , 0)] & 255); //nombre de canaux
  • en_tete[0x18] = (char)(((long)FE[SendDlgItemMessage(hWnd, IDC_COMBO_FE, CB_GETCURSEL , 0 , 0)] >> 0) & 255); //fe low
  • en_tete[0x19] = (char)(((long)FE[SendDlgItemMessage(hWnd, IDC_COMBO_FE, CB_GETCURSEL , 0 , 0)] >> 8) & 255); //fe high
  • en_tete[0x1c] = (char)(((long)FE[SendDlgItemMessage(hWnd, IDC_COMBO_FE, CB_GETCURSEL , 0 , 0)]*canaux[SendDlgItemMessage(hWnd, IDC_COMBO_canaux, CB_GETCURSEL , 0 , 0)]*octets[SendDlgItemMessage(hWnd, IDC_COMBO_octets, CB_GETCURSEL , 0 , 0)]) >> 0) & 255;
  • en_tete[0x1d] = (char)(((long)FE[SendDlgItemMessage(hWnd, IDC_COMBO_FE, CB_GETCURSEL , 0 , 0)]*canaux[SendDlgItemMessage(hWnd, IDC_COMBO_canaux, CB_GETCURSEL , 0 , 0)]*octets[SendDlgItemMessage(hWnd, IDC_COMBO_octets, CB_GETCURSEL , 0 , 0)]) >> 8) & 255;
  • en_tete[0x1e] = (char)(((long)FE[SendDlgItemMessage(hWnd, IDC_COMBO_FE, CB_GETCURSEL , 0 , 0)]*canaux[SendDlgItemMessage(hWnd, IDC_COMBO_canaux, CB_GETCURSEL , 0 , 0)]*octets[SendDlgItemMessage(hWnd, IDC_COMBO_octets, CB_GETCURSEL , 0 , 0)]) >> 16) & 255;
  • en_tete[0x1f] = (char)(((long)FE[SendDlgItemMessage(hWnd, IDC_COMBO_FE, CB_GETCURSEL , 0 , 0)]*canaux[SendDlgItemMessage(hWnd, IDC_COMBO_canaux, CB_GETCURSEL , 0 , 0)]*octets[SendDlgItemMessage(hWnd, IDC_COMBO_octets, CB_GETCURSEL , 0 , 0)]) >> 24) & 255;
  • en_tete[0x20] = (char)(canaux[SendDlgItemMessage(hWnd, IDC_COMBO_canaux, CB_GETCURSEL , 0 , 0)]*octets[SendDlgItemMessage(hWnd, IDC_COMBO_octets, CB_GETCURSEL , 0 , 0)]); // 1 ou 2 ou 4 octet par echantillon
  • en_tete[0x22] = (char)(octets[SendDlgItemMessage(hWnd, IDC_COMBO_octets, CB_GETCURSEL , 0 , 0)]*8); // format 8 ou 16 bit
  • en_tete[0x28] = (char)((longueur-44) >> 0) & 255;
  • en_tete[0x29] = (char)((longueur-44) >> 8) & 255;
  • en_tete[0x2a] = (char)((longueur-44) >> 16) & 255;
  • en_tete[0x2b] = (char)((longueur-44) >> 24) & 255;
  • pointeur=0;
  • fseek(fichier, pointeur, SEEK_SET);
  • fwrite(en_tete,44,1,fichier);
  • fclose(fichier);
  • EnableWindow(GetDlgItem(hWnd,IDC_WRITE),TRUE);
  • SetDlgItemText(hWnd,IDC_STATIC1,"terminé");
  • return 0;
  • }
  • }
  • return 0;
  • }
  • //****************************************************************************
  • int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
  • {
  • DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG1),HWND_DESKTOP,DlgProc);
  • return 0;
  • }
  • //****************************************************************************
#include <windows.h>
#include "stdafx.h"
#include "resource.h"
#include <stdio.h>
#include <commdlg.h>
#include <math.h>
#include <mmsystem.h>

//****************************************************************************

BOOL CALLBACK DlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
  static char txt[64];
  static char pathname[256];
  static int status;
  static int i,j;
  static int FE[6];
  static int duree[6];
  static int frequenceG[19981], frequenceD[19981], frequence[19981];
  static int gainG[121], gainD[121], gain[121];
  static int canaux[2];
  static int octets[2];

  FILE *fichier;
  static double pi=3.1415926535897932;
  static short val;
  static unsigned long pointeur=0;
  static unsigned long longueur=0;
  static unsigned char bloc[4];
  static char en_tete[44]={0x52,0x49,0x46,0x46,  // "RIFF"
                           0x00,0x00,0x00,0x00,  // Taille du fichier moins 8 octets 
                           0x57,0x41,0x56,0x45,  // "WAVE"
                           0x66,0x6d,0x74,0x20,  // "fmt "
                           0x10,0x00,0x00,0x00,
                           0x01,0x00,            // 1 pour PCM 
                           0x02,0x00,			 // 1 pour mono, 2 pour stereo
                           0x44,0xAC,0x00,0x00,  // frequence d'echantillonnage AC44h = 44100 
                           0x10,0xb1,0x02,0x00,  // Nombre d'octets par seconde de musique 
                           0x04,0x00,			 // Nombre d'octets par échantillon 
                           0x10,0x00,			 // Nombre de bits par donnée 
                           0x64,0x61,0x74,0x61,	 // Constante "data" 
                           0x00,0x00,0x00,0x00}; // Taille du file_handle moins 116 octets 




  if (msg == WM_INITDIALOG)
   {
    ShowWindow(GetDlgItem(hWnd,IDC_COMBO_frequence),SW_HIDE);
    ShowWindow(GetDlgItem(hWnd,IDC_COMBO_gain),SW_HIDE);
    SetDlgItemText(hWnd,IDC_STATIC1," ");
    SendDlgItemMessage(hWnd, IDC_EDIT_CHEMIN, EM_LIMITTEXT, 200, 0);

    sprintf(txt,"48000");
    FE[0] = 48000;
    SendDlgItemMessage(hWnd, IDC_COMBO_FE , CB_ADDSTRING , 0 , (LPARAM)txt);
    sprintf(txt,"44100");
    FE[1] = 44100;
    SendDlgItemMessage(hWnd, IDC_COMBO_FE , CB_ADDSTRING , 0 , (LPARAM)txt);
    sprintf(txt,"32000");
    FE[2] = 32000;
    SendDlgItemMessage(hWnd, IDC_COMBO_FE , CB_ADDSTRING , 0 , (LPARAM)txt);
    sprintf(txt,"22050");
    FE[3] = 22050;
    SendDlgItemMessage(hWnd, IDC_COMBO_FE , CB_ADDSTRING , 0 , (LPARAM)txt);
    sprintf(txt,"11025");
    FE[4] = 11025;
    SendDlgItemMessage(hWnd, IDC_COMBO_FE , CB_ADDSTRING , 0 , (LPARAM)txt);
    sprintf(txt,"8000");
    FE[5] = 8000;
    SendDlgItemMessage(hWnd, IDC_COMBO_FE , CB_ADDSTRING , 0 , (LPARAM)txt);
    SendDlgItemMessage(hWnd, IDC_COMBO_FE , CB_SETCURSEL , 1 , 0);

    sprintf(txt,"100 ms");
    duree[0] = 100;
    SendDlgItemMessage(hWnd, IDC_COMBO_duree , CB_ADDSTRING , 0 , (LPARAM)txt);
    sprintf(txt,"200 ms");
    duree[1] = 200;
    SendDlgItemMessage(hWnd, IDC_COMBO_duree , CB_ADDSTRING , 0 , (LPARAM)txt);
    sprintf(txt,"500 ms");
    duree[2] = 500;
    SendDlgItemMessage(hWnd, IDC_COMBO_duree , CB_ADDSTRING , 0 , (LPARAM)txt);
    sprintf(txt,"1000 ms");
    duree[3] = 1000;
    SendDlgItemMessage(hWnd, IDC_COMBO_duree , CB_ADDSTRING , 0 , (LPARAM)txt);
    sprintf(txt,"2000 ms");
    duree[4] = 2000;
    SendDlgItemMessage(hWnd, IDC_COMBO_duree , CB_ADDSTRING , 0 , (LPARAM)txt);
    sprintf(txt,"5000 ms");
    duree[5] = 5000;
    SendDlgItemMessage(hWnd, IDC_COMBO_duree , CB_ADDSTRING , 0 , (LPARAM)txt);
    SendDlgItemMessage(hWnd, IDC_COMBO_duree , CB_SETCURSEL , 3 , 0);

    sprintf(txt,"mono");
    canaux[0] = 1;
    SendDlgItemMessage(hWnd, IDC_COMBO_canaux , CB_ADDSTRING , 0 , (LPARAM)txt);
    sprintf(txt,"stereo");
    canaux[1] = 2;
    SendDlgItemMessage(hWnd, IDC_COMBO_canaux , CB_ADDSTRING , 0 , (LPARAM)txt);
    SendDlgItemMessage(hWnd, IDC_COMBO_canaux , CB_SETCURSEL , 1 , 0);

    sprintf(txt,"8 bit");
    octets[0] = 1;
    SendDlgItemMessage(hWnd, IDC_COMBO_octets , CB_ADDSTRING , 0 , (LPARAM)txt);
    sprintf(txt,"16 bit");
    octets[1] = 2;
    SendDlgItemMessage(hWnd, IDC_COMBO_octets , CB_ADDSTRING , 0 , (LPARAM)txt);
    SendDlgItemMessage(hWnd, IDC_COMBO_octets , CB_SETCURSEL , 1 , 0);

    for(i=0; i<19981; i++)
     {
      sprintf(txt,"%d Hz",i+20);
      frequenceG[i] = frequenceD[i] = frequence[i] = i;
      SendDlgItemMessage(hWnd, IDC_COMBO_frequenceG , CB_ADDSTRING , 0 , (LPARAM)txt);
      SendDlgItemMessage(hWnd, IDC_COMBO_frequenceD , CB_ADDSTRING , 0 , (LPARAM)txt);
      SendDlgItemMessage(hWnd, IDC_COMBO_frequence , CB_ADDSTRING , 0 , (LPARAM)txt);
     }
    SendDlgItemMessage(hWnd, IDC_COMBO_frequenceG , CB_SETCURSEL , 420 , 0);
    SendDlgItemMessage(hWnd, IDC_COMBO_frequenceD , CB_SETCURSEL , 420 , 0);
    SendDlgItemMessage(hWnd, IDC_COMBO_frequence , CB_SETCURSEL , 420 , 0);

    j = 0;
    for(i=0; i<121; i++)
     {
      sprintf(txt,"%d dB",j);
      gainG[i] = gainD[i] = gain[i] = j;
      SendDlgItemMessage(hWnd, IDC_COMBO_gainG , CB_ADDSTRING , 0 , (LPARAM)txt);      
      SendDlgItemMessage(hWnd, IDC_COMBO_gainD , CB_ADDSTRING , 0 , (LPARAM)txt);      
      SendDlgItemMessage(hWnd, IDC_COMBO_gain , CB_ADDSTRING , 0 , (LPARAM)txt);
      j--;
     }
    SendDlgItemMessage(hWnd, IDC_COMBO_gainG , CB_SETCURSEL , 0 , 0);
    SendDlgItemMessage(hWnd, IDC_COMBO_gainD , CB_SETCURSEL , 0 , 0);
    SendDlgItemMessage(hWnd, IDC_COMBO_gain , CB_SETCURSEL , 0 , 0);        

    return 0;
   }



  if (msg == WM_COMMAND)
   {
    if ((LOWORD(wParam)) == IDC_COMBO_canaux)
     {
      if (SendDlgItemMessage(hWnd, IDC_COMBO_canaux, CB_GETCURSEL , 0 , 0) == 0) // mono
       {
        ShowWindow(GetDlgItem(hWnd,IDC_COMBO_frequence),SW_SHOW);
        ShowWindow(GetDlgItem(hWnd,IDC_COMBO_gain),SW_SHOW);
        ShowWindow(GetDlgItem(hWnd,IDC_STATIC_G),SW_HIDE);
        ShowWindow(GetDlgItem(hWnd,IDC_STATIC_D),SW_HIDE);
        ShowWindow(GetDlgItem(hWnd,IDC_COMBO_frequenceG),SW_HIDE);
        ShowWindow(GetDlgItem(hWnd,IDC_COMBO_frequenceD),SW_HIDE);
        ShowWindow(GetDlgItem(hWnd,IDC_COMBO_gainG),SW_HIDE);
        ShowWindow(GetDlgItem(hWnd,IDC_COMBO_gainD),SW_HIDE);
        return 0;
       }
      if (SendDlgItemMessage(hWnd, IDC_COMBO_canaux, CB_GETCURSEL , 0 , 0) == 1) // stereo
       {
        ShowWindow(GetDlgItem(hWnd,IDC_COMBO_frequence),SW_HIDE);
        ShowWindow(GetDlgItem(hWnd,IDC_COMBO_gain),SW_HIDE);
        ShowWindow(GetDlgItem(hWnd,IDC_STATIC_G),SW_SHOW);
        ShowWindow(GetDlgItem(hWnd,IDC_STATIC_D),SW_SHOW);
        ShowWindow(GetDlgItem(hWnd,IDC_COMBO_frequenceG),SW_SHOW);
        ShowWindow(GetDlgItem(hWnd,IDC_COMBO_frequenceD),SW_SHOW);
        ShowWindow(GetDlgItem(hWnd,IDC_COMBO_gainG),SW_SHOW);
        ShowWindow(GetDlgItem(hWnd,IDC_COMBO_gainD),SW_SHOW);
        return 0;
       }
      return 0;
     }

    if (wParam == IDOK)
     {
      return 0;
     }
    if (wParam == IDCANCEL)
     {
      EndDialog(hWnd, 0);
      return 0;
     }
    if (wParam == IDC_PLAY)
     {
      GetDlgItemText(hWnd, IDC_EDIT_CHEMIN,pathname,128);
      if(strlen(pathname) == 0)
       {
        MessageBox(hWnd, "nom fichier vide !", "Makewav", MB_OK);
        pathname[0]=0;
        OPENFILENAME ofn;
        memset( &ofn, 0, sizeof(OPENFILENAME) );
        ofn.lStructSize = sizeof(OPENFILENAME);
        ofn.hwndOwner = hWnd;
        ofn.lpstrFilter = "Fichiers wave";
        ofn.lpstrDefExt = "wav";
        ofn.lpstrFile = pathname;
        ofn.nMaxFile = 200;
        ofn.lpstrTitle = "Sélectionnez un fichier";
        ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_READONLY | OFN_EXTENSIONDIFFERENT | OFN_EXPLORER;
        if(GetOpenFileName(&ofn))
         {
          SetDlgItemText(hWnd,IDC_EDIT_CHEMIN,pathname);
         }
        return 0; 
       }
      PlaySound (pathname, NULL, SND_FILENAME | SND_ASYNC);
      return 0;
     }

    if (wParam == IDC_FICHIER)
     {
      pathname[0]=0;
      OPENFILENAME ofn;
      memset( &ofn, 0, sizeof(OPENFILENAME) );
      ofn.lStructSize = sizeof(OPENFILENAME);
      ofn.hwndOwner = hWnd;
      ofn.lpstrFilter = "Fichiers wave";
      ofn.lpstrDefExt = "wav";
      ofn.lpstrFile = pathname;
      ofn.nMaxFile = 200;
      ofn.lpstrTitle = "Sélectionnez un fichier";
      ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_READONLY | OFN_EXTENSIONDIFFERENT | OFN_EXPLORER;
      if(GetOpenFileName(&ofn))
       {
        SetDlgItemText(hWnd,IDC_EDIT_CHEMIN,pathname);
       }
      return 0;
     }
    if (wParam == IDC_WRITE)
     {      
      GetDlgItemText(hWnd, IDC_EDIT_CHEMIN,pathname,128);
      if(strlen(pathname) == 0)
       {
        MessageBox(hWnd, "nom fichier vide !", "Makewav", MB_OK);
        pathname[0]=0;
        OPENFILENAME ofn;
        memset( &ofn, 0, sizeof(OPENFILENAME) );
        ofn.lStructSize = sizeof(OPENFILENAME);
        ofn.hwndOwner = hWnd;
        ofn.lpstrFilter = "Fichiers wave";
        ofn.lpstrDefExt = "wav";
        ofn.lpstrFile = pathname;
        ofn.nMaxFile = 200;
        ofn.lpstrTitle = "Enregistrer sous";
        ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_READONLY | OFN_EXTENSIONDIFFERENT | OFN_EXPLORER;
        if(GetSaveFileName(&ofn))
         {
          SetDlgItemText(hWnd,IDC_EDIT_CHEMIN,pathname);
         }
        return 0; 
       }
      fichier = fopen(pathname,"wb");
      if (fichier == 0)
       {
        MessageBox(hWnd, "ouverture fichier impossible !", "Makewav", MB_OK);
        return 0;
       }
      EnableWindow(GetDlgItem(hWnd,IDC_WRITE),FALSE);
      SetDlgItemText(hWnd,IDC_STATIC1,"écriture...");
      pointeur = 44;
      fseek(fichier, pointeur, SEEK_SET);

      for (i=0;i<(FE[SendDlgItemMessage(hWnd, IDC_COMBO_FE, CB_GETCURSEL , 0 , 0)]*duree[SendDlgItemMessage(hWnd, IDC_COMBO_duree, CB_GETCURSEL , 0 , 0)]*0.001);i++)
       {
        fseek(fichier, pointeur, SEEK_SET);
        if ((SendDlgItemMessage(hWnd, IDC_COMBO_canaux, CB_GETCURSEL , 0 , 0) == 1) && (SendDlgItemMessage(hWnd, IDC_COMBO_octets, CB_GETCURSEL , 0 , 0) == 1))
        // stereo 16 bit
         {
          val = pow(10, gainG[SendDlgItemMessage(hWnd, IDC_COMBO_gainG, CB_GETCURSEL , 0 , 0)]/20.0) * 32767 * sin(2*pi*frequenceG[SendDlgItemMessage(hWnd, IDC_COMBO_frequenceG, CB_GETCURSEL , 0 , 0)]*i/FE[SendDlgItemMessage(hWnd, IDC_COMBO_FE, CB_GETCURSEL , 0 , 0)]);
          bloc[0] = (char)(val & 255);
          bloc[1] = (char)(val >> 8);          
          val = pow(10, gainD[SendDlgItemMessage(hWnd, IDC_COMBO_gainD, CB_GETCURSEL , 0 , 0)]/20.0) * 32767 * sin(2*pi*frequenceD[SendDlgItemMessage(hWnd, IDC_COMBO_frequenceD, CB_GETCURSEL , 0 , 0)]*i/FE[SendDlgItemMessage(hWnd, IDC_COMBO_FE, CB_GETCURSEL , 0 , 0)]);
          bloc[2] = (char)(val & 255);
          bloc[3] = (char)(val >> 8);
         }
        if ((SendDlgItemMessage(hWnd, IDC_COMBO_canaux, CB_GETCURSEL , 0 , 0) == 0) && (SendDlgItemMessage(hWnd, IDC_COMBO_octets, CB_GETCURSEL , 0 , 0) == 1))
        // mono 16 bit
         {
          val = pow(10, gain[SendDlgItemMessage(hWnd, IDC_COMBO_gain, CB_GETCURSEL , 0 , 0)]/20.0) * 32767 * sin(2*pi*frequence[SendDlgItemMessage(hWnd, IDC_COMBO_frequence, CB_GETCURSEL , 0 , 0)]*i/FE[SendDlgItemMessage(hWnd, IDC_COMBO_FE, CB_GETCURSEL , 0 , 0)]);
          bloc[0] = (char)(val & 255);
          bloc[1] = (char)(val >> 8);          
         }
        if ((SendDlgItemMessage(hWnd, IDC_COMBO_canaux, CB_GETCURSEL , 0 , 0) == 0) && (SendDlgItemMessage(hWnd, IDC_COMBO_octets, CB_GETCURSEL , 0 , 0) == 0))
        // mono 8 bit
         {
          val = pow(10, gain[SendDlgItemMessage(hWnd, IDC_COMBO_gain, CB_GETCURSEL , 0 , 0)]/20.0) * 127 * sin(2*pi*frequence[SendDlgItemMessage(hWnd, IDC_COMBO_frequence, CB_GETCURSEL , 0 , 0)]*i/FE[SendDlgItemMessage(hWnd, IDC_COMBO_FE, CB_GETCURSEL , 0 , 0)]);
          bloc[0] = 127+(char)(val & 255);          
         }
        if ((SendDlgItemMessage(hWnd, IDC_COMBO_canaux, CB_GETCURSEL , 0 , 0) == 1) && (SendDlgItemMessage(hWnd, IDC_COMBO_octets, CB_GETCURSEL , 0 , 0) == 0))
        // stereo 8 bit
         {
          val = pow(10, gainG[SendDlgItemMessage(hWnd, IDC_COMBO_gainG, CB_GETCURSEL , 0 , 0)]/20.0) * 127 * sin(2*pi*frequenceG[SendDlgItemMessage(hWnd, IDC_COMBO_frequenceG, CB_GETCURSEL , 0 , 0)]*i/FE[SendDlgItemMessage(hWnd, IDC_COMBO_FE, CB_GETCURSEL , 0 , 0)]);
          bloc[0] = 127+(char)(val & 255);
          val = pow(10, gainD[SendDlgItemMessage(hWnd, IDC_COMBO_gainD, CB_GETCURSEL , 0 , 0)]/20.0) * 127 * sin(2*pi*frequenceD[SendDlgItemMessage(hWnd, IDC_COMBO_frequenceD, CB_GETCURSEL , 0 , 0)]*i/FE[SendDlgItemMessage(hWnd, IDC_COMBO_FE, CB_GETCURSEL , 0 , 0)]);
          bloc[1] = 127+(char)(val & 255);
         }

        fwrite(bloc,(canaux[SendDlgItemMessage(hWnd, IDC_COMBO_canaux, CB_GETCURSEL , 0 , 0)]*octets[SendDlgItemMessage(hWnd, IDC_COMBO_octets, CB_GETCURSEL , 0 , 0)]),1,fichier);
        pointeur=pointeur+(canaux[SendDlgItemMessage(hWnd, IDC_COMBO_canaux, CB_GETCURSEL , 0 , 0)]*octets[SendDlgItemMessage(hWnd, IDC_COMBO_octets, CB_GETCURSEL , 0 , 0)]);
       }
      fseek(fichier, 0L, SEEK_END);
      longueur = ftell(fichier);
      en_tete[0x04] = (char)((longueur-8) >> 0) & 255;
      en_tete[0x05] = (char)((longueur-8) >> 8) & 255;
      en_tete[0x06] = (char)((longueur-8) >> 16) & 255;
      en_tete[0x07] = (char)((longueur-8) >> 24) & 255;
      en_tete[0x16] = (char)(canaux[SendDlgItemMessage(hWnd, IDC_COMBO_canaux, CB_GETCURSEL , 0 , 0)] & 255); //nombre de canaux
      en_tete[0x18] = (char)(((long)FE[SendDlgItemMessage(hWnd, IDC_COMBO_FE, CB_GETCURSEL , 0 , 0)] >> 0) & 255); //fe low
      en_tete[0x19] = (char)(((long)FE[SendDlgItemMessage(hWnd, IDC_COMBO_FE, CB_GETCURSEL , 0 , 0)] >> 8) & 255); //fe high
        
      en_tete[0x1c] = (char)(((long)FE[SendDlgItemMessage(hWnd, IDC_COMBO_FE, CB_GETCURSEL , 0 , 0)]*canaux[SendDlgItemMessage(hWnd, IDC_COMBO_canaux, CB_GETCURSEL , 0 , 0)]*octets[SendDlgItemMessage(hWnd, IDC_COMBO_octets, CB_GETCURSEL , 0 , 0)]) >> 0) & 255;
      en_tete[0x1d] = (char)(((long)FE[SendDlgItemMessage(hWnd, IDC_COMBO_FE, CB_GETCURSEL , 0 , 0)]*canaux[SendDlgItemMessage(hWnd, IDC_COMBO_canaux, CB_GETCURSEL , 0 , 0)]*octets[SendDlgItemMessage(hWnd, IDC_COMBO_octets, CB_GETCURSEL , 0 , 0)]) >> 8) & 255;
      en_tete[0x1e] = (char)(((long)FE[SendDlgItemMessage(hWnd, IDC_COMBO_FE, CB_GETCURSEL , 0 , 0)]*canaux[SendDlgItemMessage(hWnd, IDC_COMBO_canaux, CB_GETCURSEL , 0 , 0)]*octets[SendDlgItemMessage(hWnd, IDC_COMBO_octets, CB_GETCURSEL , 0 , 0)]) >> 16) & 255;
      en_tete[0x1f] = (char)(((long)FE[SendDlgItemMessage(hWnd, IDC_COMBO_FE, CB_GETCURSEL , 0 , 0)]*canaux[SendDlgItemMessage(hWnd, IDC_COMBO_canaux, CB_GETCURSEL , 0 , 0)]*octets[SendDlgItemMessage(hWnd, IDC_COMBO_octets, CB_GETCURSEL , 0 , 0)]) >> 24) & 255;
       
      en_tete[0x20] = (char)(canaux[SendDlgItemMessage(hWnd, IDC_COMBO_canaux, CB_GETCURSEL , 0 , 0)]*octets[SendDlgItemMessage(hWnd, IDC_COMBO_octets, CB_GETCURSEL , 0 , 0)]); // 1 ou 2 ou 4 octet par echantillon
      en_tete[0x22] = (char)(octets[SendDlgItemMessage(hWnd, IDC_COMBO_octets, CB_GETCURSEL , 0 , 0)]*8); // format 8 ou 16 bit
      
      en_tete[0x28] = (char)((longueur-44) >> 0) & 255;
      en_tete[0x29] = (char)((longueur-44) >> 8) & 255;
      en_tete[0x2a] = (char)((longueur-44) >> 16) & 255;
      en_tete[0x2b] = (char)((longueur-44) >> 24) & 255;
        
      pointeur=0;
      fseek(fichier, pointeur, SEEK_SET);
      fwrite(en_tete,44,1,fichier);
      fclose(fichier);
      EnableWindow(GetDlgItem(hWnd,IDC_WRITE),TRUE);
      SetDlgItemText(hWnd,IDC_STATIC1,"terminé");
      return 0;
     }
   }





  return 0;
}

//****************************************************************************
 
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
  DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG1),HWND_DESKTOP,DlgProc);
  return 0;
}

//****************************************************************************


 Fichier Zip

Les Membres Club peuvent télécharger directement un fichier contenu dans le zip sans télécharger le zip en entier !

Télécharger le zip


 Historique

31 octobre 2005 17:18:47 :
ajout de valeurs simplifications
24 février 2007 21:52:08 :
correction de l'erreur de la definition de l'octet 0x20 de l'entete du fichier
24 février 2007 23:33:53 :
mise en page
03 mars 2007 00:39:47 :
refonte complète

 Sources du même auteur

Source avec Zip Source avec une capture MOTEUR AUDIO TEMPS REEL AVEC GESTION DU VOLUME
Source avec Zip Source avec une capture GÉNÉRATEUR DE SIGNAL BASSE FRÉQUENCE TEMPS RÉEL
Source avec Zip Source avec une capture PLUGIN ECHO POUR WINAMP
MODIFIER LA HAUTEUR DE LA BARRE DE TACHES
Source avec Zip ICONE DANS BARRE DE TACHES AVEC GESTION DOUBLE CLIC DROIT OU...

 Sources de la même categorie

Source avec Zip ADAPTER LES TEMPS DE SUBTITLES DE SOUS TITRAGE ENTRE DEUX LA... par berrami
Source avec Zip Source avec une capture DÉTECTION DE VISAGE (YEUX, NEZ, BOUCHE) AVEC OPENCV EN TEMPS... par MadM@tt
Source avec Zip Source avec une capture GÉNÉRATEUR FM EXPÉRIMENTAL par tontonCD
Source avec Zip LECTEUR MULTIMÉDIA par omegatou
Source avec Zip IMPLÉMENTATION D'UN ALGORITHME DE COMPRESSION/DECOMPRESSION ... par eemikhm

 Sources en rapport avec celle ci

Source avec Zip Source avec une capture GENERE BMP par lajouad
Source avec Zip Source avec une capture GETIONNAIRE D'UNE BIBLIOTHÉQUE EN C par benzarabel
FONCTION D'ÉDITION DE FICHIER BIT À BIT [C-MULTIPLATEFORME] par lynxtyle
Source avec Zip Source avec une capture UN GESTIONNAIRE DU FICHIER par benzarabel
Source avec Zip Source avec une capture TROUVER LES NOMBRES PREMIERS INFÉRIEURS À UNE LIMITE DONNÉE par angrevol

Commentaires et avis

Commentaire de Patrice99 le 25/10/2005 08:35:55

Super ! Et voici de quoi tester ton logiciel :-)

VBWaveComp : Le comparateur de spectre audio en VB .Net
Vers un "benchmark" de la compression audio
www.vbfrance.com/code.aspx?ID=5319

Commentaire de KrEiTeCh le 16/06/2006 15:05:13

merci pour ton code gabuzomeuh.
juste une petite question, le fichier que tu lis dans ton programme "fabrique" est sensé contenir quoi exactement? est ce que c'est une fichier audio ou autre chose ?

Commentaire de darunia le 23/08/2006 23:50:52

Merci a toi pour cette source ! Tres efficace, et c'est exectement ce que je cherchais.
Est ce que le code wav peut etre directement passé à sndPlaySound ?

Commentaire de darunia le 14/06/2007 18:29:39

Quel dommage d'avoir melé le code de la fenetre à la fonction !!!

Tu aurais du garder ta fonction "fabrique", car le code est devenu vraiment illisible .... Dommage, car c'est une source très interessante.

Commentaire de gabuzomeuh le 15/06/2007 21:35:52

Tu as raison DARUNIA, je vais le modifier en isolant la fonction de calcul comme avant.

 Ajouter un commentaire


Discussions en rapport avec ce code source dans le forum

[TURBO C++] charger un fichier sonore (.WAV, .VOC, MIDI...) [ par kobee12 ] JE suis actuellement en train de faire une applicatiion en mode 13h avec gestion de la souris et chargement d'image .BMP sous TURBO C++.J'aimerais pou Enregistrer en HEXA un texte avec gcc !! [ par UncleShu ] /* * Ce programme affiche le fichier en HEXADECIMAL et se copie lui-même avec * une autre exetenstion (.txt). Moi je voudrais qui affiche le fichier * ouvrir un fichier .wav sous Vc++ .....:-( [ par kinder ] hi !J'voudrais lancer un son (.wav de préferance) en exécutant un programme compillé par Vc++... Si y a un sauveur sur le web... Je suis ouvert à tout Creation de fichier .lib [ par mmuller57 ] Bonjour, depuis quelques jours je cherche comment créer une librairie (fichier *.lib). Si quelqu'un le sait ou a une idée, qu'il me contact ! @+ creation d'un BMP [ par Lord_Folkien ] Hello a tous,Je cherche a créer un fichier BMP. J'ai créer mes variable BITMAPFILEHEADER et BITMAPINFOHEADER mais dans la variable BITMAPFILEHEADER j creation fichier.dat [ par Arnaud16022 ] bonjour tt le monde!mon probleme est simple: COMMENT creer un fichier en .dat, et le lire,histoire de mettre mes images dedans?j'ai dev c++ ET visual Creation de fichier [ par PLUiK ] SalutJai fait une source qui devrait normalement me créer un fichier la voici:[b]#include &lt;windows.h&gt;int WINAPI WinMain (HINSTANCE hThisInstance creation d'un fichier avi avec plusieur avi [ par gregbds ] bonjour je voudrais cr&#233;er un fichier video avi &#224; partir de plusieur morceaux de fichier avi mis bout &#224; bout. Je recherche se petit prog creation de fichier txt expliquez moi svp [ par mathious ] bonjour a tous d'abord!!!!Voila je vous explique je suis totalement d&#233;butant&nbsp; en langage&nbsp;C et je voudrais que quelqu'un m'explique comm coment on integre un fichier wav dans une source [ par yoshimua ] je voudrais savoir comment on peut lire un fichier wav a partir d'un programme en C++


Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 1,264 sec (4)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales