Ajout version Release/x64 avec les libraries x64 et tuning de la version Debug

This commit is contained in:
MarcEricMartel
2021-12-10 07:16:43 -05:00
parent 9b56a9b4a5
commit f4ec4816af
2745 changed files with 292873 additions and 8 deletions

View File

@@ -0,0 +1,68 @@
<?xml version="1.0"?>
<!DOCTYPE CodeBlocks_project_file>
<CodeBlocks_project_file>
<FileVersion major="1" minor="1"/>
<Project>
<Option title="06.Recording"/>
<Option makefile="Makefile"/>
<Option makefile_is_custom="0"/>
<Option active_target="1"/>
<Option compiler="0"/>
<Build>
<Target title="Debug">
<Option output="..\..\bin\win32-gcc\06.Recording.exe"/>
<Option working_dir="."/>
<Option object_output="Debug"/>
<Option deps_output=".deps"/>
<Option type="1"/>
<Option compiler="0"/>
<Option projectResourceIncludeDirsRelation="1"/>
<Compiler>
<Add option="-DWIN32"/>
<Add option="-D_DEBUG"/>
<Add option="-D_CONSOLE"/>
<Add option="-W"/>
<Add option="-O0"/>
<Add directory="..\..\include"/>
</Compiler>
<Linker>
<Add directory="..\..\lib\win32-gcc"/>
</Linker>
</Target>
<Target title="Release">
<Option output="..\..\bin\win32-gcc\06.Recording.exe"/>
<Option working_dir="."/>
<Option object_output="Release"/>
<Option deps_output=".deps"/>
<Option type="1"/>
<Option compiler="0"/>
<Option projectResourceIncludeDirsRelation="1"/>
<Compiler>
<Add option="-DWIN32"/>
<Add option="-DNDEBUG"/>
<Add option="-D_CONSOLE"/>
<Add option="-W"/>
<Add option="-g"/>
<Add directory="..\..\include"/>
</Compiler>
<Linker>
<Add directory="..\..\lib\win32-gcc"/>
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-Os"/>
<Add option="-O1"/>
<Add option="-O"/>
</Compiler>
<Linker>
<Add option="-s"/>
<Add library="..\..\lib\win32-gcc\libirrklang.a"/>
</Linker>
<Unit filename="main.cpp">
<Option compilerVar="CPP"/>
<Option target="Debug"/>
<Option target="Release"/>
</Unit>
</Project>
</CodeBlocks_project_file>

View File

@@ -0,0 +1,21 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 2013 for Windows Desktop
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "06.Recording", "06.Recording.vcxproj", "{C9328295-3D0A-446B-8522-6C1B6FC7F4E6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C9328295-3D0A-446B-8522-6C1B6FC7F4E6}.Debug|x64.ActiveCfg = Debug|x64
{C9328295-3D0A-446B-8522-6C1B6FC7F4E6}.Debug|x64.Build.0 = Debug|x64
{C9328295-3D0A-446B-8522-6C1B6FC7F4E6}.Release|x64.ActiveCfg = Release|x64
{C9328295-3D0A-446B-8522-6C1B6FC7F4E6}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{C9328295-3D0A-446B-8522-6C1B6FC7F4E6}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>12.0.21005.1</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<TargetName>../../bin/Winx64-visualStudio/$(ProjectName)</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>../../bin/Winx64-visualStudio/06.Recording.exe</OutputFile>
<AdditionalLibraryDirectories>../../lib/Winx64-visualStudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)06.Recording.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>../../bin/Winx64-visualStudio/06.Recording.exe</OutputFile>
<AdditionalLibraryDirectories>../../lib/Winx64-visualStudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="main.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,127 @@
// This example will show how to record and play back audio. Additionally,
// the example shows how to write recorded audio out into a .WAV file.
// Audio recording is currently only supported on windows, so this
// example won't work on Linux or MacOS for now.
// Lets start: include the irrKlang headers and other input/output stuff
// needed to print and get user input from the console. And as exlained
// in the first tutorial, we use the namespace irr and audio and
// link to the irrKlang.dll file.
#include <stdio.h>
#include <irrKlang.h>
// include console I/O methods (conio.h for windows, our wrapper in linux)
#if defined(WIN32)
#include <conio.h>
#else
#include "../common/conio.h"
#endif
#pragma comment(lib, "irrKlang.lib") // link with irrKlang.dll
using namespace irrklang;
void writeWaveFile(const char* filename, SAudioStreamFormat format, void* data);
// The following will simply start up the irrklang engine, create an audio recorder, record
// some audio when the user presses a key, and save that data to a wave file. Additionally,
// the data is added into the sound engine and played back as well.
int main(int argc, const char** argv)
{
ISoundEngine* engine = createIrrKlangDevice();
IAudioRecorder* recorder = createIrrKlangAudioRecorder(engine);
if (!engine || !recorder)
{
printf("Could not create audio engine or audio recoder\n");
return 1;
}
printf("\nPress any key to start recording audio...\n");
getch();
// record some audio
recorder->startRecordingBufferedAudio();
printf("\nRECORDING. Press any key to stop...\n");
getch();
recorder->stopRecordingAudio();
printf("\nRecording done, recorded %dms of audio.\n",
recorder->getAudioFormat().FrameCount * 1000 / recorder->getAudioFormat().SampleRate );
printf("Press any key to play back recorded audio...\n");
getch();
// write the recorded audio as wave file
writeWaveFile("recorded.wav", recorder->getAudioFormat(), recorder->getRecordedAudioData());
// play the recorded audio
recorder->addSoundSourceFromRecordedAudio("myRecordedVoice");
engine->play2D("myRecordedVoice", true);
// wait until user presses a key
printf("\nPress any key to quit...");
getch();
recorder->drop();
engine->drop(); // delete engine
return 0;
}
// writes the recorded audio data into a .WAV file
void writeWaveFile(const char* filename, SAudioStreamFormat format, void* data)
{
if (!data)
{
printf("Could not save recorded data to %s, nothing recorded\n", filename);
return;
}
FILE* file = fopen(filename, "wb");
if (file)
{
// write wave header
unsigned short formatType = 1;
unsigned short numChannels = format.ChannelCount;
unsigned long sampleRate = format.SampleRate;
unsigned short bitsPerChannel = format.getSampleSize() * 8;
unsigned short bytesPerSample = format.getFrameSize() ;
unsigned long bytesPerSecond = format.getBytesPerSecond();
unsigned long dataLen = format.getSampleDataSize();
const int fmtChunkLen = 16;
const int waveHeaderLen = 4 + 8 + fmtChunkLen + 8;
unsigned long totalLen = waveHeaderLen + dataLen;
fwrite("RIFF", 4, 1, file);
fwrite(&totalLen, 4, 1, file);
fwrite("WAVE", 4, 1, file);
fwrite("fmt ", 4, 1, file);
fwrite(&fmtChunkLen, 4, 1, file);
fwrite(&formatType, 2, 1, file);
fwrite(&numChannels, 2, 1, file);
fwrite(&sampleRate, 4, 1, file);
fwrite(&bytesPerSecond, 4, 1, file);
fwrite(&bytesPerSample, 2, 1, file);
fwrite(&bitsPerChannel, 2, 1, file);
// write data
fwrite("data", 4, 1, file);
fwrite(&dataLen, 4, 1, file);
fwrite(data, dataLen, 1, file);
// finish
printf("Saved audio as %s\n", filename);
fclose(file);
}
else
printf("Could not open %s to write audio data\n", filename);
}