#include "stdafx.h" #include "wavedll.h" #include<stdio.h> #include<conio.h> #include<stdlib.h> #include<math.h> #ifdef _DEBUG #define new DEBUG_NEW #endif extern "C" __declspec(dllexport) unsigned int file_length(char *file_name,int retour) { Wave_File file; int i,j=0; FILE *fd; if(fd=fopen("essai.txt","wb")) { read_RIFF_Chunk(&file,fd); read_FMT_Chunk(&file,fd); read_DATA_Chunk(&file,fd); fclose(fd); } else { strcpy(file.File_Name,"ERREUR"); } file.RIFF=(RIFF_Chunk *)malloc(sizeof(RIFF_Chunk)); file.FMT=(FMT_Chunk *)malloc(sizeof(FMT_Chunk)); file.DATA=(DATA_Chunk *)malloc(sizeof(DATA_Chunk)); open_file(&file); if(!strcmpi(file.File_Name,"ERREUR")) { retour= fade_max_length(file); } else { // retour=fade_max_length(&file); retour=-1; } return (retour); }
if(!strcmpi(file.File_Name,"ERREUR")) { retour= fade_max_length(&file); } else { retour=-1; } return (retour); }