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,65 @@
<?xml version="1.0"?>
<!DOCTYPE CodeBlocks_project_file>
<CodeBlocks_project_file>
<FileVersion major="1" minor="1"/>
<Project>
<Option title="01.HelloWorld"/>
<Option makefile="Makefile"/>
<Option makefile_is_custom="0"/>
<Option active_target="1"/>
<Option compiler="0"/>
<Build>
<Target title="Debug">
<Option output="..\..\bin\win32-gcc\01.HelloWorld.exe"/>
<Option working_dir="."/>
<Option object_output="Debug"/>
<Option deps_output=".deps"/>
<Option type="1"/>
<Option compiler="0"/>
<Option projectResourceIncludeDirsRelation="1"/>
<Compiler>
<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\01.HelloWorld.exe"/>
<Option working_dir="."/>
<Option object_output="Release"/>
<Option deps_output=".deps"/>
<Option type="1"/>
<Option compiler="0"/>
<Option projectResourceIncludeDirsRelation="1"/>
<Compiler>
<Add option="-W"/>
<Add option="-g"/>
<Add option="-DWIN32"/>
<Add option="-DNDEBUG"/>
<Add option="-D_CONSOLE"/>
<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}") = "01.HelloWorld", "01.HelloWorld.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/01.HelloWorld.exe</OutputFile>
<AdditionalLibraryDirectories>../../lib/Winx64-visualStudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)01.HelloWorld.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/01.HelloWorld.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,251 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 42;
objects = {
/* Begin PBXBuildFile section */
23CDAB110C51F05E003DA087 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23CDAB100C51F05E003DA087 /* main.cpp */; };
23CDAB130C51F082003DA087 /* libirrklang.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 23CDAB120C51F082003DA087 /* libirrklang.dylib */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
8DD76F690486A84900D96B5E /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 8;
dstPath = /usr/share/man/man1/;
dstSubfolderSpec = 0;
files = (
);
runOnlyForDeploymentPostprocessing = 1;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
23CDAB100C51F05E003DA087 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
23CDAB120C51F082003DA087 /* libirrklang.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libirrklang.dylib; path = "../../bin/macosx-gcc/libirrklang.dylib"; sourceTree = SOURCE_ROOT; };
8DD76F6C0486A84900D96B5E /* 01.HelloWorld */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = 01.HelloWorld; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
8DD76F660486A84900D96B5E /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
23CDAB130C51F082003DA087 /* libirrklang.dylib in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
08FB7794FE84155DC02AAC07 /* macosx_xcode */ = {
isa = PBXGroup;
children = (
23CDAB120C51F082003DA087 /* libirrklang.dylib */,
08FB7795FE84155DC02AAC07 /* Source */,
C6859E8C029090F304C91782 /* Documentation */,
1AB674ADFE9D54B511CA2CBB /* Products */,
);
name = macosx_xcode;
sourceTree = "<group>";
};
08FB7795FE84155DC02AAC07 /* Source */ = {
isa = PBXGroup;
children = (
23CDAB100C51F05E003DA087 /* main.cpp */,
);
name = Source;
sourceTree = "<group>";
};
1AB674ADFE9D54B511CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
8DD76F6C0486A84900D96B5E /* 01.HelloWorld */,
);
name = Products;
sourceTree = "<group>";
};
C6859E8C029090F304C91782 /* Documentation */ = {
isa = PBXGroup;
children = (
);
name = Documentation;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
8DD76F620486A84900D96B5E /* macosx_xcode */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1DEB923108733DC60010E9CD /* Build configuration list for PBXNativeTarget "macosx_xcode" */;
buildPhases = (
8DD76F640486A84900D96B5E /* Sources */,
8DD76F660486A84900D96B5E /* Frameworks */,
8DD76F690486A84900D96B5E /* CopyFiles */,
23CDAAE90C51E99B003DA087 /* ShellScript */,
);
buildRules = (
);
dependencies = (
);
name = macosx_xcode;
productInstallPath = "$(HOME)/bin";
productName = macosx_xcode;
productReference = 8DD76F6C0486A84900D96B5E /* 01.HelloWorld */;
productType = "com.apple.product-type.tool";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "01.HelloWorld" */;
compatibilityVersion = "Xcode 2.4";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
Japanese,
French,
German,
);
mainGroup = 08FB7794FE84155DC02AAC07 /* macosx_xcode */;
projectDirPath = "";
projectRoot = "";
targets = (
8DD76F620486A84900D96B5E /* macosx_xcode */,
);
};
/* End PBXProject section */
/* Begin PBXShellScriptBuildPhase section */
23CDAAE90C51E99B003DA087 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"$(BUILT_PRODUCTS_DIR)/$(PRODUCT_NAME)",
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "install_name_tool -change /usr/local/lib/libirrklang.dylib @executable_path/libirrklang.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME\"";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
8DD76F640486A84900D96B5E /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
23CDAB110C51F05E003DA087 /* main.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
1DEB923208733DC60010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CONFIGURATION_BUILD_DIR = "../../bin/macosx-gcc";
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
INSTALL_PATH = "$(HOME)/bin";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
"$(LIBRARY_SEARCH_PATHS_QUOTED_2)",
);
LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/../../../bin/macosx-gcc\"";
LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)/../../bin/macosx-gcc\"";
OBJROOT = "../../bin/macosx-gcc";
PRODUCT_NAME = 01.HelloWorld;
SYMROOT = "../../bin/macosx-gcc";
ZERO_LINK = YES;
};
name = Debug;
};
1DEB923308733DC60010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
CONFIGURATION_BUILD_DIR = "../../bin/macosx-gcc";
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_MODEL_TUNING = G5;
INSTALL_PATH = "$(HOME)/bin";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
"$(LIBRARY_SEARCH_PATHS_QUOTED_2)",
);
LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/../../../bin/macosx-gcc\"";
LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)/../../bin/macosx-gcc\"";
PRODUCT_NAME = 01.HelloWorld;
};
name = Release;
};
1DEB923608733DC60010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CONFIGURATION_BUILD_DIR = "../../bin/macosx-gcc";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = ../../include;
OBJROOT = "../../bin/macosx-gcc";
PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
SYMROOT = "../../bin/macosx-gcc";
};
name = Debug;
};
1DEB923708733DC60010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = ../../include;
OBJROOT = "../../bin/macosx-gcc";
PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
SYMROOT = "../../bin/macosx-gcc";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
1DEB923108733DC60010E9CD /* Build configuration list for PBXNativeTarget "macosx_xcode" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB923208733DC60010E9CD /* Debug */,
1DEB923308733DC60010E9CD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "01.HelloWorld" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB923608733DC60010E9CD /* Debug */,
1DEB923708733DC60010E9CD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
}

View File

@@ -0,0 +1,8 @@
CPP = g++
OPTS = -I"../../include" -L"/usr/lib" ../../bin/linux-gcc-64/libIrrKlang.so -pthread
all:
$(CPP) main.cpp -o example $(OPTS)
clean:
rm example

View File

@@ -0,0 +1,78 @@
// This example will show how to play sounds using irrKlang.
// It will play a looped background music and a sound every
// time the user presses a key.
// At the beginning, we need to include the irrKlang headers (irrKlang.h) and
// the iostream headers needed to print text to the console.
#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
// Also, we tell the compiler to use the namespaces 'irrklang'.
// All classes and functions of irrKlang can be found in the namespace 'irrklang'.
// If you want to use a class of the engine,
// you'll have to type an irrklang:: before the name of the class.
// For example, to use the ISoundEngine, write: irrklang::ISoundEngine. To avoid having
// to put irrklang:: before of the name of every class, we tell the compiler that
// we use that namespaces here.
using namespace irrklang;
// To be able to use the irrKlang.dll file, we need to link with the irrKlang.lib.
// We could set this option in the project settings, but to make it easy we use
// a pragma comment:
#pragma comment(lib, "irrKlang.lib") // link with irrKlang.dll
// Now lets start with irrKlang 3D sound engine example 01, demonstrating simple 2D sound.
// Start up the sound engine using createIrrKlangDevice(). You can specify several
// options as parameters when invoking that function, but for this example, the default
// parameters are enough.
int main(int argc, const char** argv)
{
// start the sound engine with default parameters
ISoundEngine* engine = createIrrKlangDevice();
if (!engine)
{
printf("Could not startup engine\n");
return 0; // error starting up the engine
}
// To play a sound, we only to call play2D(). The second parameter
// tells the engine to play it looped.
// play some sound stream, looped
engine->play2D("../../media/getout.ogg", true);
// In a loop, wait until user presses 'q' to exit or another key to
// play another sound.
printf("\nHello World!\n");
do
{
printf("Press any key to play some sound, press 'q' to quit.\n");
// play a single sound
engine->play2D("../../media/bell.wav");
}
while(getch() != 'q');
// After we are finished, we have to delete the irrKlang Device created earlier
// with createIrrKlangDevice(). Use ::drop() to do that. In irrKlang, you should
// delete all objects you created with a method or function that starts with 'create'.
// (an exception is the play2D()- or play3D()-method, see the documentation or the
// next example for an explanation)
// The object is deleted simply by calling ->drop().
engine->drop(); // delete engine
return 0;
}

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="02.3DSound"/>
<Option makefile="Makefile"/>
<Option makefile_is_custom="0"/>
<Option active_target="1"/>
<Option compiler="0"/>
<Build>
<Target title="Debug">
<Option output="..\..\bin\win32-gcc\02.3DSound.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\02.3DSound.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}") = "02.3DSound", "02.3DSound.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/02.3DSound.exe</OutputFile>
<AdditionalLibraryDirectories>../../lib/Winx64-visualStudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)02.3DSound.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/02.3DSound.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,245 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 42;
objects = {
/* Begin PBXBuildFile section */
23CDAB110C51F05E003DA087 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23CDAB100C51F05E003DA087 /* main.cpp */; };
23CDAB130C51F082003DA087 /* libirrklang.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 23CDAB120C51F082003DA087 /* libirrklang.dylib */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
8DD76F690486A84900D96B5E /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 8;
dstPath = /usr/share/man/man1/;
dstSubfolderSpec = 0;
files = (
);
runOnlyForDeploymentPostprocessing = 1;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
23CDAB100C51F05E003DA087 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
23CDAB120C51F082003DA087 /* libirrklang.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libirrklang.dylib; path = "../../bin/macosx-gcc/libirrklang.dylib"; sourceTree = SOURCE_ROOT; };
8DD76F6C0486A84900D96B5E /* 02.3DSound */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = 02.3DSound; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
8DD76F660486A84900D96B5E /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
23CDAB130C51F082003DA087 /* libirrklang.dylib in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
08FB7794FE84155DC02AAC07 /* macosx_xcode */ = {
isa = PBXGroup;
children = (
23CDAB120C51F082003DA087 /* libirrklang.dylib */,
08FB7795FE84155DC02AAC07 /* Source */,
C6859E8C029090F304C91782 /* Documentation */,
1AB674ADFE9D54B511CA2CBB /* Products */,
);
name = macosx_xcode;
sourceTree = "<group>";
};
08FB7795FE84155DC02AAC07 /* Source */ = {
isa = PBXGroup;
children = (
23CDAB100C51F05E003DA087 /* main.cpp */,
);
name = Source;
sourceTree = "<group>";
};
1AB674ADFE9D54B511CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
8DD76F6C0486A84900D96B5E /* 02.3DSound */,
);
name = Products;
sourceTree = "<group>";
};
C6859E8C029090F304C91782 /* Documentation */ = {
isa = PBXGroup;
children = (
);
name = Documentation;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
8DD76F620486A84900D96B5E /* macosx_xcode */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1DEB923108733DC60010E9CD /* Build configuration list for PBXNativeTarget "macosx_xcode" */;
buildPhases = (
8DD76F640486A84900D96B5E /* Sources */,
8DD76F660486A84900D96B5E /* Frameworks */,
8DD76F690486A84900D96B5E /* CopyFiles */,
23CDAAE90C51E99B003DA087 /* ShellScript */,
);
buildRules = (
);
dependencies = (
);
name = macosx_xcode;
productInstallPath = "$(HOME)/bin";
productName = macosx_xcode;
productReference = 8DD76F6C0486A84900D96B5E /* 02.3DSound */;
productType = "com.apple.product-type.tool";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "02.3DSound" */;
compatibilityVersion = "Xcode 2.4";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
Japanese,
French,
German,
);
mainGroup = 08FB7794FE84155DC02AAC07 /* macosx_xcode */;
projectDirPath = "";
projectRoot = "";
targets = (
8DD76F620486A84900D96B5E /* macosx_xcode */,
);
};
/* End PBXProject section */
/* Begin PBXShellScriptBuildPhase section */
23CDAAE90C51E99B003DA087 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"$(BUILT_PRODUCTS_DIR)/$(PRODUCT_NAME)",
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "install_name_tool -change /usr/local/lib/libirrklang.dylib @executable_path/libirrklang.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME\"";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
8DD76F640486A84900D96B5E /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
23CDAB110C51F05E003DA087 /* main.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
1DEB923208733DC60010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
INSTALL_PATH = "$(HOME)/bin";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
"$(LIBRARY_SEARCH_PATHS_QUOTED_2)",
);
LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/../../../bin/macosx-gcc\"";
LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)/../../bin/macosx-gcc\"";
PRODUCT_NAME = 02.3DSound;
ZERO_LINK = YES;
};
name = Debug;
};
1DEB923308733DC60010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_MODEL_TUNING = G5;
INSTALL_PATH = "$(HOME)/bin";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
"$(LIBRARY_SEARCH_PATHS_QUOTED_2)",
);
LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/../../../bin/macosx-gcc\"";
LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)/../../bin/macosx-gcc\"";
PRODUCT_NAME = 02.3DSound;
};
name = Release;
};
1DEB923608733DC60010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CONFIGURATION_BUILD_DIR = "../../bin/macosx-gcc";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = ../../include;
OBJROOT = "../../bin/macosx-gcc";
PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
};
name = Debug;
};
1DEB923708733DC60010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
CONFIGURATION_BUILD_DIR = "../../bin/macosx-gcc";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = ../../include;
OBJROOT = "../../bin/macosx-gcc";
PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
1DEB923108733DC60010E9CD /* Build configuration list for PBXNativeTarget "macosx_xcode" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB923208733DC60010E9CD /* Debug */,
1DEB923308733DC60010E9CD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "02.3DSound" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB923608733DC60010E9CD /* Debug */,
1DEB923708733DC60010E9CD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
}

View File

@@ -0,0 +1,21 @@
CPP = g++
OPTS = -I"../../include" -L"/usr/lib" ../../bin/linux-gcc-64/libIrrKlang.so -pthread
all: example
example:
$(CPP) main.cpp -o example $(OPTS)
@echo ""
@echo "Note: to start: This example needs mp3 playback and to find the mp3 plugin for this. Please start this example with bin/linux-gcc/ as working directory."
@echo ""
@echo "Alternative: run 'make run' now."
clean:
rm example
run: example
cd ../../bin/linux-gcc-64/ && ../../examples-64/02.3DSound/example && cd ../../examples-64/02.3DSound

View File

@@ -0,0 +1,144 @@
// This example will show how to play sounds in 3D space using irrKlang.
// An mp3 file file be played in 3D space and moved around the user and a
// sound will be played at a random 3D position every time the user presses
// a key.
// For this example, we need some function to sleep for some seconds,
// so we include the platform specific sleep functions here. This is
// only need for demo purposes and has nothing to do with sound output.
// include console I/O methods (conio.h for windows, our wrapper in linux)
#if defined(WIN32)
#include <windows.h>
#include <conio.h>
inline void sleepSomeTime() { Sleep(100); }
#else
#include "../common/conio.h"
#endif
// 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>
using namespace irrklang;
#pragma comment(lib, "irrKlang.lib") // link with irrKlang.dll
// Now let's start with the irrKlang 3D sound engine example 02,
// demonstrating simple 3D sound. Simply startup the engine using
// using createIrrKlangDevice() with default options/parameters.
int main(int argc, const char** argv)
{
// start the sound engine with default parameters
ISoundEngine* engine = createIrrKlangDevice();
if (!engine)
return 0; // error starting up the engine
// Now play some sound stream as music in 3d space, looped.
// We are setting the last parameter named 'track' to 'true' to
// make irrKlang return a pointer to the played sound. (This is also returned
// if the parameter 'startPaused' is set to true, by the way). Note that you
// MUST call ->drop to the returned pointer if you don't need it any longer and
// don't want to waste any memory. This is done in the end of the program.
ISound* music = engine->play3D("../../media/ophelia.mp3",
vec3df(0,0,0), true, false, true);
// the following step isn't necessary, but to adjust the distance where
// the 3D sound can be heard, we set some nicer minimum distance
// (the default min distance is 1, for a small object). The minimum
// distance simply is the distance in which the sound gets played
// at maximum volume.
if (music)
music->setMinDistance(5.0f);
// Print some help text and start the display loop
printf("\nPlaying streamed sound in 3D.");
printf("\nPress ESCAPE to quit, any other key to play sound at random position.\n\n");
printf("+ = Listener position\n");
printf("o = Playing sound\n");
float posOnCircle = 0;
const float radius = 5;
while(true) // endless loop until user exits
{
// Each step we calculate the position of the 3D music.
// For this example, we let the
// music position rotate on a circle:
posOnCircle += 0.04f;
vec3df pos3d(radius * cosf(posOnCircle), 0,
radius * sinf(posOnCircle * 0.5f));
// After we know the positions, we need to let irrKlang know about the
// listener position (always position (0,0,0), facing forward in this example)
// and let irrKlang know about our calculated 3D music position
engine->setListenerPosition(vec3df(0,0,0), vec3df(0,0,1));
if (music)
music->setPosition(pos3d);
// Now print the position of the sound in a nice way to the console
// and also print the play position
char stringForDisplay[] = " + ";
int charpos = (int)((pos3d.X + radius) / radius * 10.0f);
if (charpos >= 0 && charpos < 20)
stringForDisplay[charpos] = 'o';
int playPos = music ? music->getPlayPosition() : 0;
printf("\rx:(%s) 3dpos: %.1f %.1f %.1f, playpos:%d:%.2d ",
stringForDisplay, pos3d.X, pos3d.Y, pos3d.Z,
playPos/60000, (playPos%60000)/1000 );
sleepSomeTime();
// Handle user input: Every time the user presses a key in the console,
// play a random sound or exit the application if he pressed ESCAPE.
if (kbhit())
{
int key = getch();
if (key == 27)
break; // user pressed ESCAPE key
else
{
// Play random sound at some random position.
// Note that when calling play3D(), no pointer is returned because we didn't
// specify the sound to start paused or to track it (as we did above
// with the music), so we also don't need to call drop().
vec3df pos(fmodf((float)rand(),radius*2)-radius, 0, 0);
const char* filename;
if (rand()%2)
filename = "../../media/bell.wav";
else
filename = "../../media/explosion.wav";
engine->play3D(filename, pos);
printf("\nplaying %s at %.1f %.1f %.1f\n",
filename, pos.X, pos.Y, pos.Z);
}
}
}
// don't forget to release the resources as explained above.
if (music)
music->drop(); // release music stream.
engine->drop(); // delete engine
return 0;
}

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="03.MemoryPlayback"/>
<Option makefile="Makefile"/>
<Option makefile_is_custom="0"/>
<Option active_target="1"/>
<Option compiler="0"/>
<Build>
<Target title="Debug">
<Option output="..\..\bin\win32-gcc\03.MemoryPlayback.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\03.MemoryPlayback.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}") = "03.MemoryPlayback", "03.MemoryPlayback.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/03.MemoryPlayback.exe</OutputFile>
<AdditionalLibraryDirectories>../../lib/Winx64-visualStudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)03.MemoryPlayback.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/03.MemoryPlayback.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,245 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 42;
objects = {
/* Begin PBXBuildFile section */
23CDAB110C51F05E003DA087 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23CDAB100C51F05E003DA087 /* main.cpp */; };
23CDAB130C51F082003DA087 /* libirrklang.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 23CDAB120C51F082003DA087 /* libirrklang.dylib */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
8DD76F690486A84900D96B5E /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 8;
dstPath = /usr/share/man/man1/;
dstSubfolderSpec = 0;
files = (
);
runOnlyForDeploymentPostprocessing = 1;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
23CDAB100C51F05E003DA087 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
23CDAB120C51F082003DA087 /* libirrklang.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libirrklang.dylib; path = "../../bin/macosx-gcc/libirrklang.dylib"; sourceTree = SOURCE_ROOT; };
8DD76F6C0486A84900D96B5E /* 03.MemoryPlayback */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = 03.MemoryPlayback; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
8DD76F660486A84900D96B5E /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
23CDAB130C51F082003DA087 /* libirrklang.dylib in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
08FB7794FE84155DC02AAC07 /* macosx_xcode */ = {
isa = PBXGroup;
children = (
23CDAB120C51F082003DA087 /* libirrklang.dylib */,
08FB7795FE84155DC02AAC07 /* Source */,
C6859E8C029090F304C91782 /* Documentation */,
1AB674ADFE9D54B511CA2CBB /* Products */,
);
name = macosx_xcode;
sourceTree = "<group>";
};
08FB7795FE84155DC02AAC07 /* Source */ = {
isa = PBXGroup;
children = (
23CDAB100C51F05E003DA087 /* main.cpp */,
);
name = Source;
sourceTree = "<group>";
};
1AB674ADFE9D54B511CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
8DD76F6C0486A84900D96B5E /* 03.MemoryPlayback */,
);
name = Products;
sourceTree = "<group>";
};
C6859E8C029090F304C91782 /* Documentation */ = {
isa = PBXGroup;
children = (
);
name = Documentation;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
8DD76F620486A84900D96B5E /* macosx_xcode */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1DEB923108733DC60010E9CD /* Build configuration list for PBXNativeTarget "macosx_xcode" */;
buildPhases = (
8DD76F640486A84900D96B5E /* Sources */,
8DD76F660486A84900D96B5E /* Frameworks */,
8DD76F690486A84900D96B5E /* CopyFiles */,
23CDAAE90C51E99B003DA087 /* ShellScript */,
);
buildRules = (
);
dependencies = (
);
name = macosx_xcode;
productInstallPath = "$(HOME)/bin";
productName = macosx_xcode;
productReference = 8DD76F6C0486A84900D96B5E /* 03.MemoryPlayback */;
productType = "com.apple.product-type.tool";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "03.MemoryPlayback" */;
compatibilityVersion = "Xcode 2.4";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
Japanese,
French,
German,
);
mainGroup = 08FB7794FE84155DC02AAC07 /* macosx_xcode */;
projectDirPath = "";
projectRoot = "";
targets = (
8DD76F620486A84900D96B5E /* macosx_xcode */,
);
};
/* End PBXProject section */
/* Begin PBXShellScriptBuildPhase section */
23CDAAE90C51E99B003DA087 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"$(BUILT_PRODUCTS_DIR)/$(PRODUCT_NAME)",
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "install_name_tool -change /usr/local/lib/libirrklang.dylib @executable_path/libirrklang.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME\"";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
8DD76F640486A84900D96B5E /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
23CDAB110C51F05E003DA087 /* main.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
1DEB923208733DC60010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
INSTALL_PATH = "$(HOME)/bin";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
"$(LIBRARY_SEARCH_PATHS_QUOTED_2)",
);
LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/../../../bin/macosx-gcc\"";
LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)/../../bin/macosx-gcc\"";
PRODUCT_NAME = 03.MemoryPlayback;
ZERO_LINK = YES;
};
name = Debug;
};
1DEB923308733DC60010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_MODEL_TUNING = G5;
INSTALL_PATH = "$(HOME)/bin";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
"$(LIBRARY_SEARCH_PATHS_QUOTED_2)",
);
LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/../../../bin/macosx-gcc\"";
LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)/../../bin/macosx-gcc\"";
PRODUCT_NAME = 03.MemoryPlayback;
};
name = Release;
};
1DEB923608733DC60010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CONFIGURATION_BUILD_DIR = "../../bin/macosx-gcc";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = ../../include;
OBJROOT = "../../bin/macosx-gcc";
PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
};
name = Debug;
};
1DEB923708733DC60010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
CONFIGURATION_BUILD_DIR = "../../bin/macosx-gcc";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = ../../include;
OBJROOT = "../../bin/macosx-gcc";
PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
1DEB923108733DC60010E9CD /* Build configuration list for PBXNativeTarget "macosx_xcode" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB923208733DC60010E9CD /* Debug */,
1DEB923308733DC60010E9CD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "03.MemoryPlayback" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB923608733DC60010E9CD /* Debug */,
1DEB923708733DC60010E9CD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
}

View File

@@ -0,0 +1,8 @@
CPP = g++
OPTS = -I"../../include" -L"/usr/lib" ../../bin/linux-gcc-64/libIrrKlang.so -pthread
all:
$(CPP) main.cpp -o example $(OPTS)
clean:
rm example

View File

@@ -0,0 +1,240 @@
// This example will show how to play sounds directly from memory using irrKlang.
// This is useful for embedding sounds directly in executables as well for
// making irrKlang work together with different APIs like advanced decoders or
// middleware such as Shockwave.
// lets start: include irrKlang headers and other input/output stuff
// needed to print and get user input from the console.
#include <stdio.h>
#include <irrKlang.h>
using namespace irrklang;
// 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
// the following huge array simply represents the plain sound data we
// want to play back. It is just the content of a .wav file from the
// game 'Hell Troopers'. Usually this sound is somewhere provided by
// some external software, but to keep it simple we just use this array as memory.
// test.wav, converted to this array by bin2h tool, available at bin2h.irrlicht3d.org
int memorySoundDataSize = 3932; // data size in bytes
int memorySoundData[] = {
0x46464952, 0xf54, 0x45564157, 0x20746d66, 0x12,
0x10001, 0x1f40, 0x1f40, 0x80001, 0x61660000, 0x47463,
0xf220000, 0x61640000, 0xf226174, 0x807f0000, 0x80807f7f, 0x7f808080,
0x80818080, 0x7f7f7e80, 0x7f807f7f, 0x80808081, 0x7e7e7e80, 0x807e7e7e,
0x7f7f7f7f, 0x7e7e7f7f, 0x7f7e7e7e, 0x807f8080, 0x8181807f, 0x80808180,
0x80808080, 0x83818181, 0x87868584, 0x85878786, 0x4f5a7183, 0x8a816d6e,
0x97918f8c, 0x5f6e7684, 0x85837768, 0x95949089, 0x6b707b8f, 0x83807672,
0x908f8c84, 0x6f727f87, 0x7d7b7770, 0x87858482, 0x76797e86, 0x807e7977,
0x8987857f, 0x7b7c8085, 0x837f7f7b, 0x888a8884, 0x7d7c7d85, 0x948b8380,
0x318da69d, 0x92735250, 0xbb818f7e, 0x5b879fb8, 0x805f4c45, 0x978f8a7c,
0x6a95a8a7, 0x7863575b, 0x95878483, 0x81929a9a, 0x75655f60, 0x8283847f,
0x7b8c918e, 0x7b706a73, 0x88878886, 0x80878987, 0x7e757475, 0x84848684,
0x7c838384, 0x867e7a78, 0x93949390, 0x3c5e879b, 0x98493e3b, 0xab9d9d99,
0x518e97a0, 0x6f58493e, 0xa09da799, 0x808a95a2, 0x705d505a, 0x949d9b7e,
0x7b84868a, 0x695d5f71, 0x91999688, 0x81807e88, 0x87828080, 0xa7a29d8f,
0x3131aead, 0x87783147, 0xc1baabbc, 0x319db2a3, 0x5f523139, 0xb7a4b281,
0x809b9aab, 0x513e376a, 0xadb0986b, 0x7c8f95aa, 0x53536c7e, 0xa4917764,
0x707d97a1, 0x76717370, 0x948b7977, 0x74869097, 0x7d79706d, 0x92898786,
0xa09d9c98, 0x31a2b3a7, 0x7f573150, 0xc2a1c0b7, 0x4a65b39f, 0x31333166,
0xc0c6a1a0, 0x7ca5a0b9, 0x31465271, 0xc68e8342, 0x7078a9b7, 0x6e70616d,
0x8e827b6d, 0x7c939f96, 0xa290797e, 0x97bdb8aa, 0x31313136, 0xaaa06b47,
0xc1adbfc6, 0x316b6db0, 0x7e6e3131, 0xbdbcc5c0, 0x6e7e91af, 0x543c3645,
0xbeb58f65, 0x5a7897ae, 0x796e5a5b, 0x9f93887e, 0x7989a0a0, 0xb0847b77,
0x43a0c2be, 0x44313145, 0xbdafa569, 0x89c6a59f, 0x3131429d, 0xba644731,
0xa4c1bec7, 0x63848a96, 0x40364255, 0xb2ae7d6b, 0x959da7b2, 0x5f607b7d,
0x99806b62, 0xb5c3c3c4, 0x3131417b, 0xa4843931, 0xc6bdbdbb, 0x456faab0,
0x31313131, 0xc6c4aa86, 0x85a8b6c3, 0x313e6476, 0xa3523731, 0xc1c5c6c3,
0x657685b5, 0x8b796562, 0x8789b3a3, 0x4537313a, 0x92998760, 0xa38cb09d,
0x4f737c87, 0x75654145, 0xaaa7b29f, 0x7b8394a0, 0x4f5a5967, 0xa2916957,
0x9dafbabc, 0x9d928a93, 0x315a7fb3, 0x60313131, 0xb6c4c2b2, 0x92897bbc,
0x33586a6b, 0x846e4d31, 0xb2c4c4c9, 0x5b657398, 0x58625658, 0xb89a8866,
0xadbec5c3, 0x6a84a6ac, 0x31313131, 0xc7ab8331, 0xa9b8c6c3, 0x5566699b,
0x3c313138, 0xc5b8a24f, 0x87a3c5c3, 0x58535274, 0x7b705f57, 0xc4c2b68f,
0x8399c3c4, 0x3131315a, 0xb99a4a31, 0xc3c1c8b8, 0x6a90b1c0, 0x31313148,
0xb89a6133, 0xb0c4c6c6, 0x6e7c97a1, 0x66535463, 0xc6c5947b, 0x314f97c4,
0x5f313131, 0xaaa08a7a, 0xb6b5af9d, 0x52738fba, 0x573f3131, 0xaba99c69,
0xa4a6a7ac, 0x838a94a5, 0xa58a716e, 0x7299adaf, 0x45313131, 0xc6bfaa69,
0x7a859cb3, 0x80868a74, 0x4141586e, 0xad8e734c, 0x8994afb0, 0x91898184,
0x8d8b9495, 0x9ab0a799, 0x31316888, 0x94553831, 0xa8b4b7aa, 0x8c8a8a9a,
0x5e6f878c, 0x5b3e3c3f, 0xb0a88870, 0x99a4aab1, 0xa09b9597, 0x87acacac,
0x3131576e, 0x8a553a31, 0xb1b5aba0, 0x8d959c9f, 0x5f6b7887, 0x55444247,
0xa2958764, 0xa5aeb1b0, 0x9f9b9aa1, 0x9eafada8, 0x31395485, 0x75403131,
0xb3b3af92, 0x878e969d, 0x727b8186, 0x4847505d, 0x92806f52, 0xa5a9ada6,
0x9a97979f, 0xaab0a8a4, 0x405c719f, 0x4d363131, 0x9f958f66, 0x8a8f8f98,
0x8694908f, 0x5457757b, 0x7e5b574e, 0xb1ad9a8a, 0x9aa3a7af, 0x9f9d9b9a,
0x4f77849f, 0x31313341, 0x947d6346, 0x929f98a2, 0x8184848a, 0x7c7e8382,
0x6e656a6e, 0xb0a38675, 0x91acb5b9, 0x77757b85, 0x838b8c84, 0x4a4e6673,
0x83665b4f, 0x888e928b, 0x7e757679, 0x92939186, 0x6b767e86, 0x8980766b,
0x909b9d9a, 0x6e717586, 0x8c807874, 0x848b8f91, 0x75727579, 0x87848178,
0x787a8284, 0x7e7b7876, 0x83868684, 0x78797a81, 0x86837d7a, 0x83868888,
0x7c7a7c7e, 0x8483827e, 0x7e808384, 0x7f7d7d7d, 0x7e7f8081, 0x7978797c,
0x817f7e7c, 0x7d7e8080, 0x817e7e7d, 0x81828282, 0x7e7d7d80, 0x8383817f,
0x7f818384, 0x7e7e7d7e, 0x80818180, 0x7e7e7e7e, 0x81807f7e, 0x7f7e8080,
0x817f807e, 0x81828282, 0x7c7d7e80, 0x8281807d, 0x80818182, 0x80818080,
0x7d7e7f80, 0x7e7c7c7d, 0x8181807f, 0x80808081, 0x81818080, 0x7e808181,
0x7e7e7d7e, 0x807f7f7e, 0x81808080, 0x80808180, 0x7f7f8080, 0x7e7e7e7e,
0x7f7e7e7e, 0x807f807f, 0x81808080, 0x7e808181, 0x7c7c7e7e, 0x807e7e7d,
0x80808080, 0x80808080, 0x7e7e8080, 0x7e7e7e7e, 0x7f7f7e7e, 0x80807f7f,
0x80808080, 0x80818080, 0x7e7e8080, 0x7e7e7e7d, 0x7e7e7f7f, 0x8080807f,
0x80808080, 0x807f8080, 0x807f7e7f, 0x7f7f7f7f, 0x807f807f, 0x8180807f,
0x807f8080, 0x7e7e7e7d, 0x80807f7e, 0x81808080, 0x7f808080, 0x7e7f7f7f,
0x80807f7f, 0x7f7f8080, 0x7f807f7e, 0x80808080, 0x7e808080, 0x7e7e7e7e,
0x8080807f, 0x7f808080, 0x7e7f7f7f, 0x80807f80, 0x7f807f80, 0x807f807f,
0x80808080, 0x7f7f7f7f, 0x8080807f, 0x7f7f7f7f, 0x807f807f, 0x80808080,
0x7f808080, 0x7f807e7f, 0x80808080, 0x7f7f7e7f, 0x807f8080, 0x80808080,
0x80807f80, 0x7f7f7e7f, 0x7f7f7f7f, 0x80808080, 0x80808080, 0x7e7e7e7f,
0x7f7e7e7f, 0x7e7f7f80, 0x80807f7f, 0x807f7f7f, 0x807f8080, 0x7f7f7f80,
0x80807e7e, 0x81808080, 0x7f7f8080, 0x7e7e7e7e, 0x945f7880, 0x787c908a,
0x89aaa75b, 0xa17f6868, 0x43617b95, 0x76aeaa97, 0x97ac5b4e, 0x886e4f76,
0x31889099, 0x86acbb7a, 0x98a96e6e, 0x7152457c, 0x7d8a9eab, 0x8a979086,
0x8c57515f, 0x8f7c8380, 0x858e9994, 0x81858780, 0x6487877c, 0x78756d6a,
0x927c8774, 0x91899689, 0x7b718786, 0x66766780, 0x797d756d, 0x9c938f83,
0x7b7c828d, 0x7973737f, 0x8c7a8070, 0x8383847a, 0x8b8c8384, 0x6b898079,
0x7d817c79, 0x848f8681, 0x89949187, 0x8691887e, 0x80817e87, 0x817b7886,
0x7578707a, 0x776a666d, 0x867d7978, 0x97918e8a, 0x979d9491, 0xa2999c96,
0x476cb0a4, 0x38505d80, 0x6b565862, 0x887e7c7b, 0x596a7975, 0x686d7052,
0xa4afac7f, 0xb3bdc3c0, 0x73bcc3bd, 0x31527b67, 0x604d5a31, 0xa19e9587,
0x76818699, 0x3e4b3e47, 0x9a876d4a, 0xc3bbc1c8, 0xc3bebfc3, 0x3889317e,
0x70513131, 0xb7ada777, 0x717cb6b5, 0x42315a77, 0x714a3146, 0xc1c99f99,
0xbec5c3c7, 0x3131c4b7, 0x31313145, 0xc8b3847e, 0x93c0c1bc, 0x314a5960,
0x45473a31, 0xbab98f71, 0xc3c5c3c2, 0xbfbeb7c3, 0x31683165, 0x8fb33131,
0xbfc5bab5, 0x52348ec1, 0x5f313131, 0xad976a5a, 0xc4c3c6c1, 0xb0b0c3c3,
0x6a3175c0, 0x73313149, 0xbfcdb595, 0x3f8ebebb, 0x31313f47, 0x8c7b603f,
0xbebeb9aa, 0xaebfc3c2, 0x3173bfad, 0x3131335b, 0xc9c09d7a, 0x79b6baba,
0x31373f31, 0x8c765231, 0xbbb2a7ac, 0xc0c2b1ad, 0x5fc3abbd, 0x31393131,
0xc0b28e31, 0xc2b5bac9, 0x313131b3, 0x78603131, 0xbaacab82, 0xc5b8abb9,
0xc5adbbbe, 0x594131a7, 0xa54b3131, 0xb6bccca8, 0x313c95c1, 0x4c313139,
0xa5ad8c85, 0x9cabafad, 0xafbfc0c3, 0x31315dc1, 0x8e313131, 0xbac6c6aa,
0x31abc6b3, 0x31313131, 0xba908165, 0xa1b4b2a8, 0xb3c3b69c, 0x31a1c1bb,
0x3131545e, 0xccaa9b53, 0x86c0b0b6, 0x31383935, 0x99805635, 0xaea89fb2,
0xc0c69da5, 0x9dc3b1c2, 0x31315231, 0xb39da431, 0xc2bfbebe, 0x313a3185,
0x87733331, 0xb5a4af9d, 0xc2b39fa5, 0xa3beb2bf, 0x315f3131, 0xaaa25131,
0xc1b3becb, 0x3e3135c3, 0x724d3131, 0xb8a9ad9b, 0xbea6acc1, 0xb8bbb8bd,
0x316d316b, 0x9b7f3131, 0xbac3c8c0, 0x3f3161b1, 0x63343131, 0xb0b5aa8d,
0xa499a5bd, 0xc3b2b7c5, 0x645f31a1, 0x8f543131, 0xbcc2bfa5, 0x443a8fc3,
0x4f31313a, 0xaead9b81, 0x9ba9b6be, 0xc8a5b1b9, 0x9d4c31b5, 0x94993131,
0xbbb8c584, 0x4d31a5c7, 0x40313154, 0xb2a48f78, 0xa5acbdc1, 0xc5afa7b6,
0xb16231b8, 0x90b23131, 0xb9b3c176, 0x5d319dca, 0x7031315f, 0xacaa8c76,
0xacaabbbd, 0xc7abaac3, 0x318331ad, 0x79bd3131, 0xc0b3ba83, 0x6c3187c6,
0x73313152, 0xb2af9177, 0xb1a3a7c5, 0x91ba9ea9, 0x3175a831, 0xa4b98131,
0xc6b2b9cd, 0x386c316c, 0x74623331, 0xc5baa896, 0xb2a7a4c1, 0x89c794a1,
0x316bab31, 0xac688f31, 0xc8afb6cd, 0x366d3166, 0x72653c31, 0xc5b8ab94,
0xa8b0a8bd, 0x91c58a8f, 0x317fa531, 0xa8718631, 0xb7adadcd, 0x3f753169,
0x7a653d31, 0xc5b6a88d, 0xaaafa5bf, 0x8bc59097, 0x316dab31, 0xac699331,
0xb5b1b3b1, 0x39703164, 0x7b6a3f31, 0xc4bda28c, 0xa9aba1a7, 0xa8c38c91,
0x319e9031, 0x8b77be31, 0xc0b2afb6, 0x4d774281, 0x795d3131, 0xc3bea887,
0xa7ad9faa, 0xc8ae9197, 0x31b13131, 0x62c28031, 0xc5afaccd, 0x835c31b8,
0x706f3131, 0xc3a48a6e, 0xb7aea3b8, 0xb39c8aab, 0xa3a231a2, 0xc6653131,
0xb8afcd81, 0x5d367bc1, 0x6431314a, 0xb88e8071, 0xa48fb8c5, 0xa68a87b9,
0x3131c7b7, 0x6b3131a8, 0xb6c863c3, 0x49bac1b4, 0x31319575, 0x8a5b6937,
0x92b0ae93, 0x86a6b2ad, 0xc4bba79d, 0x31c63131, 0x3fb33131, 0xc1b8b5c8,
0x948d76b3, 0x4c513131, 0xa89c7955, 0xa99791ad, 0xa7a2798a, 0x31c5b899,
0x31317531, 0xcb31a188, 0xbac5baad, 0x319c9662, 0x44465e31, 0xa5a08c8c,
0x92aaa2a2, 0x8d94988e, 0x3eb1c696, 0x3131bb87, 0xa250634d, 0x9abbb8ad,
0x3168a373, 0x51455b48, 0xa7a8947c, 0x7e90aca4, 0x8582967a, 0x94c0b29f,
0x318fbe31, 0x5d417131, 0xb2c1b1a5, 0x31949d87, 0x4845573e, 0x9fa08b7b,
0x83a09f9c, 0x7983867b, 0xc5afa290, 0xa03131ac, 0x8c573131, 0xb6b59a38,
0xab9cadc9, 0x4f413165, 0x7d6f4a36, 0xbaa0aaa2, 0x818186aa, 0x93756a6c,
0xc4c1ac9b, 0x31c2315a, 0x3f7e3731, 0xc8b7a67d, 0xb8ada5c1, 0x3c54413e,
0x82786631, 0xb7b3b099, 0x7b847fa0, 0x887b6757, 0xc3c3b197, 0xa3936fb9,
0x37313131, 0xbfb66931, 0xb7c2c3c8, 0x47504f84, 0x7a543131, 0xc5b69f8e,
0x6d959dbe, 0x625d575c, 0xc2a0917d, 0x9fc1c4c3, 0x3169b645, 0x48313c31,
0xc3c2bdb5, 0x64a8c4c5, 0x31334f4e, 0x97805c38, 0xadc3c6b9, 0x4765929c,
0x725a514f, 0xc3bfb38a, 0x91c3c3c4, 0x3153b431, 0x555e4c31, 0xc8c2c4a5,
0x5bbec4c5, 0x31314c3b, 0x986f5f3a, 0xc1c3c6af, 0x4a62a5a6, 0x4d3e493b,
0xbdb39379, 0xc3c4c3c4, 0x9a31a4c2, 0x41313165, 0xbec64c31, 0xc0c5c2bf,
0x54476bab, 0x70363137, 0xc5bb8f6f, 0x92b2c1c5, 0x363f5480, 0x94624541,
0xc5c5b5a7, 0xb6c4c3c3, 0xb04466a2, 0x5e313131, 0xb6c77a34, 0xafc5bfc3,
0x4f514789, 0x714c3131, 0xc5c09d7e, 0x7eb2b7bf, 0x3c445b65, 0x8f635141,
0xc3c3aa9a, 0xacb8bebb, 0x3166a1af, 0x313131b8, 0xb67f3c89, 0xbbc7bca4,
0x4c4d92a4, 0x53313c5f, 0x9f917571, 0xafb4c0bd, 0x5d5075a6, 0x693a3847,
0xafa5876c, 0xb3b8bbc0, 0xa79a9aad, 0x3645658c, 0x718b3931, 0xb5bcaf34,
0xa0a5a0c0, 0x4a6d5d9a, 0x6d714e37, 0xb19f9486, 0x9ba7a8a8, 0x615a6b77,
0x7169384b, 0xa5ad927b, 0x9eaab6aa, 0xa094979a, 0xb83187a0, 0x8c3f3131,
0x92b94d36, 0x99b09ac8, 0x7b7563ad, 0x73554e3c, 0x9f90875b, 0xa1ada2a5,
0x707d7b9b, 0x4966573f, 0x8c868661, 0xaaa6b0b3, 0x8c9192a0, 0x89969689,
0x3179c131, 0x49357244, 0xbc878489, 0x80b0b2ab, 0x4974896d, 0x6658655c,
0x97968f7d, 0x909fa8a5, 0x4f718084, 0x523e7149, 0xa7818976, 0xa3a6a4b6,
0x86898a9f, 0x9893958e, 0x3ba2aa55, 0x39456254, 0x91708679, 0x93a8af9a,
0x61849176, 0x5d5b6968, 0x8c877f79, 0x989da29a, 0x73819194, 0x6a4f6b70,
0x87726555, 0x9da79189, 0x8d959caa, 0x8e818089, 0x6583928f, 0x5b5b31c9,
0x9a553c75, 0xa280976d, 0x8f819d95, 0x71736594, 0x786b5d70, 0x9483807b,
0x968e9491, 0x7b7e7e90, 0x6c5d6571, 0x84746073, 0x9fa48886, 0x8e939795,
0x817d7c82, 0x8c989486, 0x543caf5d, 0x4f4c7a61, 0x868e7c8c, 0x8d999291,
0x7270948e, 0x72667776, 0x807a7777, 0x8e8e8a8b, 0x84848f91, 0x76727c81,
0x79676e76, 0x88816e79, 0x93998987, 0x878b918f, 0x827d7e83, 0x68978c80,
0x665aa06a, 0x715b7974, 0x7e867381, 0x85958e91, 0x797b918b, 0x74707a7b,
0x7b797977, 0x8a8a8789, 0x84858e8e, 0x77797f81, 0x7a767677, 0x8478747c,
0x8a8d7a7d, 0x898c8881, 0x7f7e8480, 0x83807d80, 0x8e8e8483, 0x7c7f7391,
0x73786a69, 0x757c7365, 0x89897e7a, 0x868c8989, 0x7c817f80, 0x77797776,
0x81807976, 0x86898681, 0x83868685, 0x787b7e7e, 0x79797676, 0x80807f7b,
0x807b8680, 0x7b7f767b, 0x81857c7d, 0x84878782, 0x89858787, 0x7587918e,
0x66626594, 0x845f6574, 0x8c818079, 0x8b8a8f8f, 0x7b7a7b8f, 0x776d707a,
0x80797577, 0x8f878585, 0x8686888e, 0x77797b80, 0x76747375, 0x85837b7b,
0x89888786, 0x80808486, 0x7979787c, 0x7c7b7877, 0x8583827d, 0x86868686,
0x7d7e8183, 0x7978797b, 0x7e7b7979, 0x84848080, 0x83848486, 0x7b7c7e80,
0x7b7a7b7b, 0x807f7d7c, 0x83838481, 0x80818384, 0x7b7c7c7e, 0x7c7b7b7b,
0x8180807f, 0x81828282, 0x7e808080, 0x7c7c7c7e, 0x7e7e7e7c, 0x8181807e,
0x81818181, 0x7f808081, 0x7c7d7e7e, 0x7e7e7e7d, 0x8080807f, 0x80818180,
0x7e7f8080, 0x7d7c7c7e, 0x807e7e7d, 0x81818180, 0x7f808080, 0x7e7e7e7e,
0x7e7e7e7d, 0x8080807e, 0x80808080, 0x7e7f8080, 0x807f7f7f, 0x807f7f7f,
0x7f808080, 0x7e7f7e7f, 0x7e7e7f7f, 0x7e7e7e7f, 0x7f7f8080, 0x7f7f7f80,
0x80808080, 0x807f8080, 0x7f7f8080, 0x7e7f7e80, 0x7f7f7f7f, 0x7f7f7e7f,
0x7f7f7f7f, 0x80808080, 0x7e7e8080, 0x7e7f7e7f, 0x7e7e7e7f, 0x7f7f7f7f,
0x0};
// irrKlang 3D sound engine example 03,
// demonstrating playing sounds directly from memory
int main(int argc, const char** argv)
{
// start the sound engine with default parameters
ISoundEngine* engine = createIrrKlangDevice();
if (!engine)
return 0; // error starting up the engine
#ifdef __BIG_ENDIAN__
printf("This example won't work on Power-PCs because the way we are "\
"storing the wave data in this example source file. Sorry.");
return 0;
#endif
// To make irrKlang know about the memory we want to play, we register
// the memory chunk as a sound source. We specify the name "testsound.wav", so
// we can use the name later for playing back the sound. Note that you
// could also specify a better fitting name like "ok.wav".
// The method addSoundSource() also returns a pointer to the created sound source,
// it can be used as parameter for play2D() later, if you don't want to
// play sounds via string names.
engine->addSoundSourceFromMemory(memorySoundData, memorySoundDataSize, "testsound.wav");
// now play the sound until user presses escape
printf("\nPlaying sound from memory.\n");
printf("Press any key to play, ESCAPE to end program.\n");
while(true) // endless loop until user exits
{
// play the sound we added to memory
engine->play2D("testsound.wav");
if (getch() == 27)
break; // user pressed ESCAPE key, cancel
}
engine->drop(); // delete engine
return 0;
}

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="04.OverrideFileAccess"/>
<Option makefile="Makefile"/>
<Option makefile_is_custom="0"/>
<Option active_target="1"/>
<Option compiler="0"/>
<Build>
<Target title="Debug">
<Option output="..\..\bin\win32-gcc\04.OverrideFileAccess.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\04.OverrideFileAccess.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}") = "04.OverrideFileAccess", "04.OverrideFileAccess.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/04.OverrideFileAccess.exe</OutputFile>
<AdditionalLibraryDirectories>../../lib/Winx64-visualStudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)04.OverrideFileAccess.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/04.OverrideFileAccess.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,245 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 42;
objects = {
/* Begin PBXBuildFile section */
23CDAB110C51F05E003DA087 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23CDAB100C51F05E003DA087 /* main.cpp */; };
23CDAB130C51F082003DA087 /* libirrklang.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 23CDAB120C51F082003DA087 /* libirrklang.dylib */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
8DD76F690486A84900D96B5E /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 8;
dstPath = /usr/share/man/man1/;
dstSubfolderSpec = 0;
files = (
);
runOnlyForDeploymentPostprocessing = 1;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
23CDAB100C51F05E003DA087 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
23CDAB120C51F082003DA087 /* libirrklang.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libirrklang.dylib; path = "../../bin/macosx-gcc/libirrklang.dylib"; sourceTree = SOURCE_ROOT; };
8DD76F6C0486A84900D96B5E /* 04.OverrideFileAccess */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = 04.OverrideFileAccess; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
8DD76F660486A84900D96B5E /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
23CDAB130C51F082003DA087 /* libirrklang.dylib in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
08FB7794FE84155DC02AAC07 /* macosx_xcode */ = {
isa = PBXGroup;
children = (
23CDAB120C51F082003DA087 /* libirrklang.dylib */,
08FB7795FE84155DC02AAC07 /* Source */,
C6859E8C029090F304C91782 /* Documentation */,
1AB674ADFE9D54B511CA2CBB /* Products */,
);
name = macosx_xcode;
sourceTree = "<group>";
};
08FB7795FE84155DC02AAC07 /* Source */ = {
isa = PBXGroup;
children = (
23CDAB100C51F05E003DA087 /* main.cpp */,
);
name = Source;
sourceTree = "<group>";
};
1AB674ADFE9D54B511CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
8DD76F6C0486A84900D96B5E /* 04.OverrideFileAccess */,
);
name = Products;
sourceTree = "<group>";
};
C6859E8C029090F304C91782 /* Documentation */ = {
isa = PBXGroup;
children = (
);
name = Documentation;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
8DD76F620486A84900D96B5E /* macosx_xcode */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1DEB923108733DC60010E9CD /* Build configuration list for PBXNativeTarget "macosx_xcode" */;
buildPhases = (
8DD76F640486A84900D96B5E /* Sources */,
8DD76F660486A84900D96B5E /* Frameworks */,
8DD76F690486A84900D96B5E /* CopyFiles */,
23CDAAE90C51E99B003DA087 /* ShellScript */,
);
buildRules = (
);
dependencies = (
);
name = macosx_xcode;
productInstallPath = "$(HOME)/bin";
productName = macosx_xcode;
productReference = 8DD76F6C0486A84900D96B5E /* 04.OverrideFileAccess */;
productType = "com.apple.product-type.tool";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "04.OverrideFileAccess" */;
compatibilityVersion = "Xcode 2.4";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
Japanese,
French,
German,
);
mainGroup = 08FB7794FE84155DC02AAC07 /* macosx_xcode */;
projectDirPath = "";
projectRoot = "";
targets = (
8DD76F620486A84900D96B5E /* macosx_xcode */,
);
};
/* End PBXProject section */
/* Begin PBXShellScriptBuildPhase section */
23CDAAE90C51E99B003DA087 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"$(BUILT_PRODUCTS_DIR)/$(PRODUCT_NAME)",
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "install_name_tool -change /usr/local/lib/libirrklang.dylib @executable_path/libirrklang.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME\"";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
8DD76F640486A84900D96B5E /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
23CDAB110C51F05E003DA087 /* main.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
1DEB923208733DC60010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
INSTALL_PATH = "$(HOME)/bin";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
"$(LIBRARY_SEARCH_PATHS_QUOTED_2)",
);
LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/../../../bin/macosx-gcc\"";
LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)/../../bin/macosx-gcc\"";
PRODUCT_NAME = 04.OverrideFileAccess;
ZERO_LINK = YES;
};
name = Debug;
};
1DEB923308733DC60010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_MODEL_TUNING = G5;
INSTALL_PATH = "$(HOME)/bin";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
"$(LIBRARY_SEARCH_PATHS_QUOTED_2)",
);
LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/../../../bin/macosx-gcc\"";
LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)/../../bin/macosx-gcc\"";
PRODUCT_NAME = 04.OverrideFileAccess;
};
name = Release;
};
1DEB923608733DC60010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CONFIGURATION_BUILD_DIR = "../../bin/macosx-gcc";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = ../../include;
OBJROOT = "../../bin/macosx-gcc";
PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
};
name = Debug;
};
1DEB923708733DC60010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
CONFIGURATION_BUILD_DIR = "../../bin/macosx-gcc";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = ../../include;
OBJROOT = "../../bin/macosx-gcc";
PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
1DEB923108733DC60010E9CD /* Build configuration list for PBXNativeTarget "macosx_xcode" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB923208733DC60010E9CD /* Debug */,
1DEB923308733DC60010E9CD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "04.OverrideFileAccess" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB923608733DC60010E9CD /* Debug */,
1DEB923708733DC60010E9CD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
}

View File

@@ -0,0 +1,8 @@
CPP = g++
OPTS = -I"../../include" -L"/usr/lib" ../../bin/linux-gcc-64/libIrrKlang.so -pthread
all:
$(CPP) main.cpp -o example $(OPTS)
clean:
rm example

View File

@@ -0,0 +1,157 @@
// This example will show how to override file access with irrKlang.
// This is useful if you want to read sounds from other sources than
// just files, for example from custom internet streams or
// an own encypted archive format.
// lets start: include irrKlang headers and other input/output stuff
// needed to print and get user input from the console.
#if defined(WIN32)
#include <conio.h>
#else
#include "../common/conio.h"
#endif
#include <string.h>
#include <stdio.h>
#include <irrKlang.h>
using namespace irrklang;
#pragma comment(lib, "irrKlang.lib") // link with irrKlang.dll
// To start, we need to implement the class IFileFactory, which irrKlang uses
// to open files. The interface consists only of one single method named
// createFileReader(const ik_c8* filename). In this method, we create return
// our own file access class and return it:
// a class implementing the IFileFactory interface to override irrklang file access
class CMyFileFactory : public IFileFactory
{
public:
//! Opens a file for read access. Simply return 0 if file not found.
virtual IFileReader* createFileReader(const ik_c8* filename)
{
printf("MyFileFactory: open file %s\n", filename);
FILE* file = fopen(filename, "rb");
if (!file)
return 0;
return new CMyReadFile(file, filename);
}
protected:
// To write our own file access methods returned in the method above,
// we only need to implement the IFileReader interface, which has some
// standard methods like read(), seek(), getPos() etc. In this example
// we simply use fopen, fread, fseek etc and print to the console
// when we are reading or seeking:
// an own implementation of IReadFile to overwrite read access to files
class CMyReadFile : public IFileReader
{
public:
// constructor, store size of file and filename
CMyReadFile(FILE* openedFile, const ik_c8* filename)
{
File = openedFile;
strcpy(Filename, filename);
// get file size
fseek(File, 0, SEEK_END);
FileSize = ftell(File);
fseek(File, 0, SEEK_SET);
}
~CMyReadFile()
{
fclose(File);
}
//! reads data, returns how much was read
ik_s32 read(void* buffer, ik_u32 sizeToRead)
{
printf("CMyReadFile: read %d bytes\n", sizeToRead);
return (ik_s32)fread(buffer, 1, sizeToRead, File);
}
//! changes position in file, returns true if successful
bool seek(ik_s32 finalPos, bool relativeMovement)
{
printf("CMyReadFile: seek to position %d\n", finalPos);
return fseek(File, finalPos, relativeMovement ? SEEK_CUR : SEEK_SET) == 0;
}
//! returns size of file
ik_s32 getSize()
{
return FileSize;
}
//! returns where in the file we are.
ik_s32 getPos()
{
return ftell(File);
}
//! returns name of file
const ik_c8* getFileName()
{
return Filename;
}
FILE* File;
char Filename[1024];
ik_s32 FileSize;
}; // end class CMyReadFile
}; // end class CMyFileFactory
// The main work is done, the only thing missing is to start up the
// sound engine and tell it to use the created FileFactory for file access:
// irrKlang 3D sound engine example 04,
// demonstrating how to override file access of irrKlang
int main(int argc, const char** argv)
{
// start the sound engine with default parameters
ISoundEngine* engine = createIrrKlangDevice();
if (!engine)
return 0; // error starting up the engine
// create an instance of the file factory and let
// irrKlang know about it. irrKlang will drop() the
// factory itself if it doesn't need it any longer.
CMyFileFactory* factory = new CMyFileFactory();
engine->addFileFactory(factory);
factory->drop(); // we don't need it anymore, delete it
// that's it, play some sounds with our overriden
// file access methods:
printf("\nDemonstrating file access overriding.\n");
printf("Press any key to start playing sounds, then press escape to cancel\n");
getch();
engine->play2D("../../media/getout.ogg", true);
while(true) // endless loop until user exits
{
// play some wave sound
engine->play2D("../../media/explosion.wav");
if (getch() == 27)
break; // user pressed ESCAPE key, cancel
}
engine->drop(); // delete engine
return 0;
}

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="05.Effects"/>
<Option makefile="Makefile"/>
<Option makefile_is_custom="0"/>
<Option active_target="1"/>
<Option compiler="0"/>
<Build>
<Target title="Debug">
<Option output="..\..\bin\win32-gcc\05.Effects.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\05.Effects.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}") = "05.Effects", "05.Effects.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/05.Effects.exe</OutputFile>
<AdditionalLibraryDirectories>../../lib/Winx64-visualStudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)05.Effects.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/05.Effects.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,245 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 42;
objects = {
/* Begin PBXBuildFile section */
23CDAB110C51F05E003DA087 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23CDAB100C51F05E003DA087 /* main.cpp */; };
23CDAB130C51F082003DA087 /* libirrklang.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 23CDAB120C51F082003DA087 /* libirrklang.dylib */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
8DD76F690486A84900D96B5E /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 8;
dstPath = /usr/share/man/man1/;
dstSubfolderSpec = 0;
files = (
);
runOnlyForDeploymentPostprocessing = 1;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
23CDAB100C51F05E003DA087 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
23CDAB120C51F082003DA087 /* libirrklang.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libirrklang.dylib; path = "../../bin/macosx-gcc/libirrklang.dylib"; sourceTree = SOURCE_ROOT; };
8DD76F6C0486A84900D96B5E /* 05.Effects */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = 05.Effects; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
8DD76F660486A84900D96B5E /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
23CDAB130C51F082003DA087 /* libirrklang.dylib in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
08FB7794FE84155DC02AAC07 /* macosx_xcode */ = {
isa = PBXGroup;
children = (
23CDAB120C51F082003DA087 /* libirrklang.dylib */,
08FB7795FE84155DC02AAC07 /* Source */,
C6859E8C029090F304C91782 /* Documentation */,
1AB674ADFE9D54B511CA2CBB /* Products */,
);
name = macosx_xcode;
sourceTree = "<group>";
};
08FB7795FE84155DC02AAC07 /* Source */ = {
isa = PBXGroup;
children = (
23CDAB100C51F05E003DA087 /* main.cpp */,
);
name = Source;
sourceTree = "<group>";
};
1AB674ADFE9D54B511CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
8DD76F6C0486A84900D96B5E /* 05.Effects */,
);
name = Products;
sourceTree = "<group>";
};
C6859E8C029090F304C91782 /* Documentation */ = {
isa = PBXGroup;
children = (
);
name = Documentation;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
8DD76F620486A84900D96B5E /* macosx_xcode */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1DEB923108733DC60010E9CD /* Build configuration list for PBXNativeTarget "macosx_xcode" */;
buildPhases = (
8DD76F640486A84900D96B5E /* Sources */,
8DD76F660486A84900D96B5E /* Frameworks */,
8DD76F690486A84900D96B5E /* CopyFiles */,
23CDAAE90C51E99B003DA087 /* ShellScript */,
);
buildRules = (
);
dependencies = (
);
name = macosx_xcode;
productInstallPath = "$(HOME)/bin";
productName = macosx_xcode;
productReference = 8DD76F6C0486A84900D96B5E /* 05.Effects */;
productType = "com.apple.product-type.tool";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "05.Effects" */;
compatibilityVersion = "Xcode 2.4";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
Japanese,
French,
German,
);
mainGroup = 08FB7794FE84155DC02AAC07 /* macosx_xcode */;
projectDirPath = "";
projectRoot = "";
targets = (
8DD76F620486A84900D96B5E /* macosx_xcode */,
);
};
/* End PBXProject section */
/* Begin PBXShellScriptBuildPhase section */
23CDAAE90C51E99B003DA087 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"$(BUILT_PRODUCTS_DIR)/$(PRODUCT_NAME)",
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "install_name_tool -change /usr/local/lib/libirrklang.dylib @executable_path/libirrklang.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME\"";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
8DD76F640486A84900D96B5E /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
23CDAB110C51F05E003DA087 /* main.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
1DEB923208733DC60010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
INSTALL_PATH = "$(HOME)/bin";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
"$(LIBRARY_SEARCH_PATHS_QUOTED_2)",
);
LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/../../../bin/macosx-gcc\"";
LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)/../../bin/macosx-gcc\"";
PRODUCT_NAME = 05.Effects;
ZERO_LINK = YES;
};
name = Debug;
};
1DEB923308733DC60010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_MODEL_TUNING = G5;
INSTALL_PATH = "$(HOME)/bin";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(LIBRARY_SEARCH_PATHS_QUOTED_1)",
"$(LIBRARY_SEARCH_PATHS_QUOTED_2)",
);
LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/../../../bin/macosx-gcc\"";
LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)/../../bin/macosx-gcc\"";
PRODUCT_NAME = 05.Effects;
};
name = Release;
};
1DEB923608733DC60010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CONFIGURATION_BUILD_DIR = "../../bin/macosx-gcc";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = ../../include;
OBJROOT = "../../bin/macosx-gcc";
PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
};
name = Debug;
};
1DEB923708733DC60010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
CONFIGURATION_BUILD_DIR = "../../bin/macosx-gcc";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = ../../include;
OBJROOT = "../../bin/macosx-gcc";
PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
1DEB923108733DC60010E9CD /* Build configuration list for PBXNativeTarget "macosx_xcode" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB923208733DC60010E9CD /* Debug */,
1DEB923308733DC60010E9CD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "05.Effects" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB923608733DC60010E9CD /* Debug */,
1DEB923708733DC60010E9CD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
}

View File

@@ -0,0 +1,8 @@
CPP = g++
OPTS = -I"../../include" -L"/usr/lib" ../../bin/linux-gcc-64/libIrrKlang.so -pthread
all:
$(CPP) main.cpp -o example $(OPTS)
clean:
rm example

View File

@@ -0,0 +1,135 @@
// This example will show how to use sound effects such as echo, reverb and distortion.
// irrKlang supports the effects Chorus, Compressor, Distortion, Echo, Flanger
// Gargle, 3DL2Reverb, ParamEq and WavesReverb.
// 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.
#if defined(WIN32)
#include <conio.h>
#else
#include "../common/conio.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <irrKlang.h>
using namespace irrklang;
#pragma comment(lib, "irrKlang.lib") // link with irrKlang.dll
// Now let's start with the irrKlang 3D sound engine example 05,
// demonstrating sound effects. Simply startup the engine using
// using createIrrKlangDevice() with default options/parameters.
int main(int argc, const char** argv)
{
// start the sound engine with default parameters
ISoundEngine* engine = createIrrKlangDevice();
if (!engine)
return 0; // error starting up the engine
// we play a .xm file as music here. Note that the last parameter
// named 'enableSoundEffects' has been set to 'true' here. If this
// is not done, sound effects cannot be used with this sound.
// After this, we print some help text and start a loop which reads
// user keyboard input.
const char* filename = "../../media/MF-W-90.XM";
#ifdef __BIG_ENDIAN__
filename = "../../media/ophelia.mp3"; // no xm playback on power pcs currently
#endif
ISound* music = engine->play2D(filename,
true, false, true, ESM_AUTO_DETECT, true);
// Print some help text and start the display loop
printf("\nSound effects example. Keys:\n");
printf("\nESCAPE: quit\n");
printf("w: enable/disable waves reverb\n");
printf("d: enable/disable distortion\n");
printf("e: enable/disable echo\n");
printf("a: disable all effects\n");
while(true) // endless loop until user exits
{
int key = getch();
if (key == 27)
break; // user pressed ESCAPE key
else
{
// user maybe pressed an effects key,
// now enable or disable a sound effect.
// We get a pointer to the ISoundEffectControl interface,
// but this only exists if the sound driver supports sound effects
// and if the sound was started setting the 'enableSoundeffects' flag
// to 'true' as we did above. This pointer is only valid as long as
// we don't call music->drop() and delete the music with this.
ISoundEffectControl* fx = 0;
if (music)
fx = music->getSoundEffectControl();
if (!fx)
{
// some sound devices do not support sound effects.
printf("This device or sound does not support sound effects.\n");
continue;
}
// here we disable or enable the sound effects of the music depending
// on what key the user pressed. Note that every enableXXXSoundEffect()
// method also accepts a lot of parameters, so it is easily possible
// to influence the details of the effect. If the sound effect is
// already active, it is also possible to simply call the
// enableXXXSoundEffect() method again to just change the effect parameters,
// although we aren't doing this here.
if (key < 'a') // make key lower
key += 'a' - 'A';
switch(key)
{
case 'd':
if (fx->isDistortionSoundEffectEnabled())
fx->disableDistortionSoundEffect();
else
fx->enableDistortionSoundEffect();
break;
case 'e':
if (fx->isEchoSoundEffectEnabled())
fx->disableEchoSoundEffect();
else
fx->enableEchoSoundEffect();
break;
case 'w':
if (fx->isWavesReverbSoundEffectEnabled())
fx->disableWavesReverbSoundEffect();
else
fx->enableWavesReverbSoundEffect();
break;
case 'a':
fx->disableAllEffects();
break;
}
}
}
// don't forget to release the resources
if (music)
music->drop(); // release music stream.
engine->drop(); // delete Engine
return 0;
}

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);
}

View File

@@ -0,0 +1,123 @@
// additional headers for simple console functions under linux,
// similar to conio.h in windows.
// used for irrKlang linux examples
#ifndef __IRRKLANG_CONIO_H_INCLUDED__
#define __IRRKLANG_CONIO_H_INCLUDED__
#if !defined(_WIN32) && !defined(_WIN64) && !defined(__MACH__)
#include <termios.h>
#include <unistd.h>
#include <stdio.h>
#include <memory.h>
#include <stdlib.h>
// sleeps 100 milliseconds
inline void sleepSomeTime() { usleep(100000); }
// returns if keyboard has been hit
inline int kbhit(void)
{
termios oldTerm, newTerm;
int fd = 0;
tcgetattr(fd, &oldTerm);
newTerm = oldTerm;
newTerm.c_lflag = newTerm.c_lflag & (!ICANON);
newTerm.c_cc[VMIN] = 0;
newTerm.c_cc[VTIME] = 1;
tcsetattr(fd, TCSANOW, &newTerm);
int c = getchar();
tcsetattr(fd, TCSANOW, &oldTerm);
if (c != -1)
ungetc(c, stdin);
return ((c != -1) ? 1 : 0);
}
// waits for the user to enter a character
inline int getch()
{
termios oldTerm, newTerm;
tcgetattr( STDIN_FILENO, &oldTerm );
newTerm = oldTerm;
newTerm.c_lflag &= ~( ICANON | ECHO );
tcsetattr( STDIN_FILENO, TCSANOW, &newTerm );
int character = getchar();
tcsetattr( STDIN_FILENO, TCSANOW, &oldTerm );
return character;
}
//#endif // !defined(_WIN32) && !defined(_WIN64)
#elif defined(__MACH__)
// macOSX implementation
#include <termios.h>
#include <unistd.h>
#include <stdio.h>
#include <memory.h>
#include <stdlib.h>
#include <sys/ioctl.h>
class RawTerm // keeps the terminal in raw mode as long as an instance of this class exists
{
termios old;
public:
RawTerm()
{
tcgetattr(STDIN_FILENO, &old);
termios newt = old;
newt.c_iflag &= ~(IGNBRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON | BRKINT | PARMRK);
newt.c_lflag &= ~(ICANON | ISIG | IEXTEN|ECHO | ECHONL);
newt.c_cflag &= ~(CSIZE | PARENB);
newt.c_cflag |= CS8;
newt.c_oflag &= ~OPOST;
tcsetattr(STDIN_FILENO, 0, &newt);
}
~RawTerm()
{
tcsetattr(STDIN_FILENO, 0, &old);
}
};
inline int getch(void)
{
RawTerm myRawterm;
return getchar();
}
inline int kbhit(void)
{
RawTerm myRawterm;
int count = -1;
ioctl(STDIN_FILENO, FIONREAD, &count);
return count > 0 ? count : 0;
}
// needed for irrklang
// sleeps 100 milliseconds
inline void sleepSomeTime() { usleep(100000); }
#endif
#endif // __IRRKLANG_CONIO_H_INCLUDED__