This commit is contained in:
2025-11-24 14:19:51 +05:30
commit f5c1412b28
6734 changed files with 1527575 additions and 0 deletions

View File

@ -0,0 +1,43 @@
#
# This file was taken from RakNet 4.082.
# Please see licenses/RakNet license.txt for the underlying license and related copyright.
#
#
# Modified work: Copyright (c) 2017-2019, SLikeSoft UG (haftungsbeschränkt)
#
# This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style
# license found in the license.txt file in the root directory of this source tree.
#
cmake_minimum_required(VERSION 2.6)
GETCURRENTFOLDER()
FINDPORTAUDIO()
FINDFMODEX()
project(${current_folder})
IF(WIN32 AND NOT UNIX)
FILE(GLOB ALL_CPP_SRCS *.cpp ${SLikeNet_SOURCE_DIR}/DependentExtensions/RakVoice.cpp)
FILE(GLOB ALL_HEADER_SRCS *.h ${SLikeNet_SOURCE_DIR}/DependentExtensions/RakVoice.h)
FILE(GLOB SPEEXFILES ${speex_SOURCE_DIR}/win32/*.h ${speex_SOURCE_DIR}/include/*.h ${speex_SOURCE_DIR}/libspeex/*.h ${speex_SOURCE_DIR}/include/speex/*.h ${speex_SOURCE_DIR}/libspeex/*.c)
LIST(REMOVE_ITEM SPEEXFILES
${speex_SOURCE_DIR}/libspeex/pcm_wrapper.h)
LIST(REMOVE_ITEM SPEEXFILES
${speex_SOURCE_DIR}/libspeex/pcm_wrapper.c)
SOURCE_GROUP(Speex FILES ${SPEEXFILES})
ADDCPPDEF(HAVE_CONFIG_H)
include_directories(${FMODEX_INCLUDE_DIR} ${SLIKENET_HEADER_FILES} ./ ${PORTAUDIO_INCLUDE_DIR} ${SLikeNet_SOURCE_DIR}/DependentExtensions ${speex_SOURCE_DIR}/include ${portaudio_SOURCE_DIR} ${speex_SOURCE_DIR}/win32)
add_executable(${current_folder} ${ALL_CPP_SRCS} ${ALL_HEADER_SRCS} ${SPEEXFILES})
target_link_libraries(${current_folder} ${SLIKENET_COMMON_LIBS} ${FMODEX_LIBRARY})
VSUBFOLDER(${current_folder} Samples/Voice)
ELSE(WIN32 AND NOT UNIX)
FILE(GLOB ALL_CPP_SRCS *.cpp)
FILE(GLOB ALL_HEADER_SRCS *.h)
include_directories(${SLIKENET_HEADER_FILES} ./ ${PORTAUDIO_INCLUDE_DIR} ${SLikeNet_SOURCE_DIR}/DependentExtensions ${FMODEX_INCLUDE_DIR})
add_executable(${current_folder} ${ALL_CPP_SRCS} ${ALL_HEADER_SRCS})
target_link_libraries(${current_folder} ${SLIKENET_COMMON_LIBS} ${PORTAUDIO_LIBRARIES} ${FMODEX_LIBRARY} LibRakVoice)
ENDIF(WIN32 AND NOT UNIX)

View File

@ -0,0 +1,237 @@
/*
* Original work: Copyright (c) 2014, Oculus VR, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* RakNet License.txt file in the licenses directory of this source tree. An additional grant
* of patent rights can be found in the RakNet Patents.txt file in the same directory.
*
*
* Modified work: Copyright (c) 2017-2020, SLikeSoft UG (haftungsbeschränkt)
*
* This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style
* license found in the license.txt file in the root directory of this source tree.
*/
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#include "slikenet/peerinterface.h"
#include "slikenet/MessageIdentifiers.h"
#include "FMODVoiceAdapter.h"
#include "fmod_errors.h"
/// To test sending to myself
//#define _TEST_LOOPBACK
// Number of RakVoice frames in the fmod sound
#define FRAMES_IN_SOUND 4
using namespace SLNet;
FMODVoiceAdapter FMODVoiceAdapter::instance;
FMODVoiceAdapter::FMODVoiceAdapter(){
rakVoice=0;
fmodSystem = 0;
recSound=0;
sound=0;
channel=0;
mute=false;
}
FMODVoiceAdapter* FMODVoiceAdapter::Instance(){
return &instance;
}
bool FMODVoiceAdapter::SetupAdapter(FMOD::System *fmodSystem, RakVoice *rakVoice)
{
FMOD_RESULT fmodErr;
RakAssert(fmodSystem);
RakAssert(rakVoice);
// Make sure rakVoice was initialized
RakAssert((rakVoice->IsInitialized())&&(rakVoice->GetRakPeerInterface()!= nullptr));
this->fmodSystem = fmodSystem;
this->rakVoice = rakVoice;
lastPlayPos = 0;
lastRecordingPos = 0;
//
// Create the FMOD sound used to record
//
FMOD_CREATESOUNDEXINFO exinfo;
memset(&exinfo, 0, sizeof(FMOD_CREATESOUNDEXINFO));
exinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO);
exinfo.numchannels = 1;
exinfo.format = FMOD_SOUND_FORMAT_PCM16;
exinfo.defaultfrequency = rakVoice->GetSampleRate();
exinfo.length = rakVoice->GetBufferSizeBytes()*FRAMES_IN_SOUND;
fmodErr = fmodSystem->createSound(0, FMOD_2D | FMOD_SOFTWARE | FMOD_OPENUSER, &exinfo, &recSound);
if (fmodErr!=FMOD_OK)
return false;
// Create the FMOD sound used to play incoming sound data
fmodErr = fmodSystem->createSound(0, FMOD_2D | FMOD_SOFTWARE | FMOD_OPENUSER, &exinfo, &sound);
if (fmodErr!=FMOD_OK)
return false;
// Start playing the sound used for output
sound->setMode(FMOD_LOOP_NORMAL);
fmodErr= fmodSystem->playSound(FMOD_CHANNEL_REUSE, sound, false, &channel);
if (fmodErr!=FMOD_OK)
return false;
// Start recording
fmodErr=fmodSystem->recordStart(0,recSound, true);
if (fmodErr!=FMOD_OK)
return false;
return true;
}
void FMODVoiceAdapter::Update(void)
{
RakAssert(fmodSystem);
UpdateSound(true);
UpdateSound(false);
}
void FMODVoiceAdapter::Release(void)
{
FMOD_RESULT err;
if (fmodSystem== nullptr) return;
// Stop recording
bool recording=false;
err = fmodSystem->isRecording(0,&recording);
RakAssert(err==FMOD_OK);
if (recording){
fmodSystem->recordStop(0);
}
// Stop what we hear
bool playing;
err = channel->isPlaying(&playing);
RakAssert(err==FMOD_OK);
if (playing){
channel->stop();
}
if (recSound!= nullptr)
{
recSound->release();
recSound = nullptr;
}
if (sound!= nullptr)
{
sound->release();
sound = nullptr;
}
}
void FMODVoiceAdapter::SetMute(bool mute)
{
this->mute = mute;
}
void FMODVoiceAdapter::UpdateSound(bool isRec)
{
FMOD_RESULT fmodErr;
unsigned int soundLength;
const int sampleSize = 2;
FMOD::Sound *snd = (isRec) ? recSound : sound;
unsigned int& lastPos = (isRec) ? lastRecordingPos : lastPlayPos;
// get current Play or recording position
unsigned int currPos;
if (isRec){
fmodErr=fmodSystem->getRecordPosition(0,&currPos);
RakAssert(fmodErr==FMOD_OK);
} else {
fmodErr=channel->getPosition(&currPos, FMOD_TIMEUNIT_PCM);
RakAssert(fmodErr==FMOD_OK);
}
// Get length of sound in samples
fmodErr=snd->getLength(&soundLength, FMOD_TIMEUNIT_PCM);
RakAssert(fmodErr==FMOD_OK);
// calculate some variables we'll need ahead
int bufferSizeBytes = rakVoice->GetBufferSizeBytes();
// Round down the current position to a multiple of buffer size in samples
currPos -= currPos % (bufferSizeBytes/sampleSize);
if ( ((!isRec)||(isRec && !mute)) && (currPos != lastPos) )
{
void *ptr1, *ptr2;
unsigned int len1, len2;
int blockLength;
blockLength = (int)currPos - (int)lastPos;
// Check for wrap around, and adjust
if (blockLength < 0)
{
blockLength += soundLength;
}
// Lock to get access to the raw data
snd->lock(lastPos * sampleSize, blockLength * sampleSize, &ptr1, &ptr2, &len1, &len2);
// Since the length and current position are both a multiple of bufferSizeBytes
// just treat treat one full buffer at a time
int numFrames = len1 / bufferSizeBytes;
while(numFrames--){
if (isRec) {
BroadcastFrame(ptr1);
} else {
rakVoice->ReceiveFrame(ptr1);
}
ptr1 = (char*)ptr1 + bufferSizeBytes;
}
numFrames = len2 / bufferSizeBytes;
while(numFrames--) {
if (isRec){
BroadcastFrame(ptr2);
} else {
rakVoice->ReceiveFrame(ptr2);
}
ptr2 = (char*)ptr2 + bufferSizeBytes;
}
snd->unlock(ptr1, ptr2, len1, len2);
}
lastPos = currPos;
}
void FMODVoiceAdapter::BroadcastFrame(void *ptr)
{
#ifndef _TEST_LOOPBACK
unsigned i;
unsigned int numPeers = rakVoice->GetRakPeerInterface()->GetMaximumNumberOfPeers();
for (i=0; i < numPeers; i++)
{
rakVoice->SendFrame(rakVoice->GetRakPeerInterface()->GetGUIDFromIndex(i), ptr);
}
#else
rakVoice->SendFrame(SLNet::UNASSIGNED_SYSTEM_ADDRESS, ptr);
#endif
}

View File

@ -0,0 +1,91 @@
/*
* Original work: Copyright (c) 2014, Oculus VR, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* RakNet License.txt file in the licenses directory of this source tree. An additional grant
* of patent rights can be found in the RakNet Patents.txt file in the same directory.
*
*
* Modified work: Copyright (c) 2017, SLikeSoft UG (haftungsbeschränkt)
*
* This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style
* license found in the license.txt file in the root directory of this source tree.
*/
/// \file
/// \brief Connection between FMOD and RakVoice
///
#ifndef __FMODVOICEBRIDGE_H
#define __FMODVOICEBRIDGE_H
#include "RakVoice.h"
// If you get:
// Error 1 fatal error C1083: Cannot open include file: 'fmod.hpp': No such file or directory c:\raknet\samples\rakvoicefmod\fmodvoiceadapter.h 9
// It is because this project depends on Fmod. If you don't have FMOD you can't use it.
#include "fmod.hpp"
namespace SLNet {
/// \brief Connects FMOD with RakVoice.
class RAK_DLL_EXPORT FMODVoiceAdapter {
public:
// --------------------------------------------------------------------------------------------
// User functions
// --------------------------------------------------------------------------------------------
/// Returns the singleton
static FMODVoiceAdapter* Instance();
/// \brief Setups the connection between FMOD and RakVoice
/// You must call this method to create the connection between FMOD and RakVoice.
/// \param[in] fmodSystem FMOD system object to use.
/// \param[in] rakVoice RakVoice object to use, fully Initialized AND attached to a RakPeerInterface.
/// \pre IMPORTANT : Don't forget to initialized and attach rakVoice, before calling this method.
/// \sa \link FMODVoiceAdapter::Update \endlink
/// \return true on success, false if an error occurred.
bool SetupAdapter(FMOD::System *fmodSystem, RakVoice *rakVoice);
/// Release any resources used.
void Release();
/// You need to call this once in a while, depending on the parameters used. Ex: call once every 20-30 milliseconds
void Update();
/// Turns on/off outgoing traffic
/// \param[in] true to mute, false to allow outgoing traffic.
void SetMute(bool mute);
private:
void UpdateSound(bool isRec);
void BroadcastFrame(void *ptr);
static FMODVoiceAdapter instance;
// As required by the Singleton Pattern, make those ones private,
// to keep the user from creating objects of this class.
FMODVoiceAdapter();
FMODVoiceAdapter(const FMODVoiceAdapter &obj) {};
// FMOD releases all his resources at shutdown, so we don't need to do anything, which
// cames in handy, as we don't need to worry about when to destroy the singleton.
~FMODVoiceAdapter() {};
RakVoice *rakVoice;
FMOD::System *fmodSystem;
FMOD::Sound *recSound; // sound used for recording
FMOD::Sound *sound; // sound used to play what we hear
FMOD::Channel *channel;
bool mute;
unsigned int lastPlayPos;
unsigned int lastRecordingPos;
};
} // namespace SLNet
#endif

View File

@ -0,0 +1,371 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug - Unicode|Win32">
<Configuration>Debug - Unicode</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release - Unicode|Win32">
<Configuration>Release - Unicode</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Retail - Unicode|Win32">
<Configuration>Retail - Unicode</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Retail|Win32">
<Configuration>Retail</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>RakVoiceFMOD</ProjectName>
<ProjectGuid>{3B5312CD-11FB-4E0D-A0F9-68B63765082F}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Retail|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release - Unicode|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Retail - Unicode|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug - Unicode|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Retail|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release - Unicode|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Retail - Unicode|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug - Unicode|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug - Unicode|Win32'">$(Configuration)\</OutDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug - Unicode|Win32'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Retail|Win32'">$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release - Unicode|Win32'">$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Retail - Unicode|Win32'">$(Configuration)\</OutDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Retail|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release - Unicode|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Retail - Unicode|Win32'">false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>./../../Source/include;./../../DependentExtensions;./../../DependentExtensions/speex-1.1.12/include;./../../DependentExtensions/speex-1.1.12/win32;C:\Program Files (x86)\FMOD SoundSystem\FMOD Programmers API Windows\api\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<AdditionalDependencies>./../../Lib/SLikeNet_LibStatic_Debug_Win32.lib;Winmm.lib;ws2_32.lib;fmodex_vc.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>C:\Program Files (x86)\FMOD SoundSystem\FMOD Programmers API Windows\api\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)RakVoice.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
<TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>
</Link>
<PostBuildEvent>
<Command>copy "C:\Program Files (x86)\FMOD SoundSystem\FMOD Programmers API Windows\api\fmodex.dll" "$(OutDir)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug - Unicode|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>./../../Source/include;./../../DependentExtensions;./../../DependentExtensions/speex-1.1.12/include;./../../DependentExtensions/speex-1.1.12/win32;C:\Program Files (x86)\FMOD SoundSystem\FMOD Programmers API Windows\api\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<AdditionalDependencies>./../../Lib/SLikeNet_LibStatic_Debug - Unicode_Win32.lib;Winmm.lib;ws2_32.lib;fmodex_vc.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>C:\Program Files (x86)\FMOD SoundSystem\FMOD Programmers API Windows\api\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)RakVoice.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
<TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>
</Link>
<PostBuildEvent>
<Command>copy "C:\Program Files (x86)\FMOD SoundSystem\FMOD Programmers API Windows\api\fmodex.dll" "$(OutDir)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>./../../Source/include;./../../DependentExtensions;./../../DependentExtensions/speex-1.1.12/include;./../../DependentExtensions/speex-1.1.12/win32;C:\Program Files (x86)\FMOD SoundSystem\FMOD Programmers API Windows\api\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<MinimalRebuild>true</MinimalRebuild>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<AdditionalDependencies>./../../Lib/SLikeNet_LibStatic_Release_Win32.lib;Winmm.lib;ws2_32.lib;fmodex_vc.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>C:\Program Files (x86)\FMOD SoundSystem\FMOD Programmers API Windows\api\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>
</Link>
<PostBuildEvent>
<Command>copy "C:\Program Files (x86)\FMOD SoundSystem\FMOD Programmers API Windows\api\fmodex.dll" "$(OutDir)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Retail|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>./../../Source/include;./../../DependentExtensions;./../../DependentExtensions/speex-1.1.12/include;./../../DependentExtensions/speex-1.1.12/win32;C:\Program Files (x86)\FMOD SoundSystem\FMOD Programmers API Windows\api\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;WIN32;_RETAIL;NDEBUG;_CONSOLE;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<MinimalRebuild>true</MinimalRebuild>
<BufferSecurityCheck>false</BufferSecurityCheck>
</ClCompile>
<Link>
<AdditionalDependencies>./../../Lib/SLikeNet_LibStatic_Retail_Win32.lib;Winmm.lib;ws2_32.lib;fmodex_vc.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>C:\Program Files (x86)\FMOD SoundSystem\FMOD Programmers API Windows\api\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>
</Link>
<PostBuildEvent>
<Command>copy "C:\Program Files (x86)\FMOD SoundSystem\FMOD Programmers API Windows\api\fmodex.dll" "$(OutDir)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release - Unicode|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>./../../Source/include;./../../DependentExtensions;./../../DependentExtensions/speex-1.1.12/include;./../../DependentExtensions/speex-1.1.12/win32;C:\Program Files (x86)\FMOD SoundSystem\FMOD Programmers API Windows\api\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<MinimalRebuild>true</MinimalRebuild>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<AdditionalDependencies>./../../Lib/SLikeNet_LibStatic_Release - Unicode_Win32.lib;Winmm.lib;ws2_32.lib;fmodex_vc.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>C:\Program Files (x86)\FMOD SoundSystem\FMOD Programmers API Windows\api\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>
</Link>
<PostBuildEvent>
<Command>copy "C:\Program Files (x86)\FMOD SoundSystem\FMOD Programmers API Windows\api\fmodex.dll" "$(OutDir)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Retail - Unicode|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>./../../Source/include;./../../DependentExtensions;./../../DependentExtensions/speex-1.1.12/include;./../../DependentExtensions/speex-1.1.12/win32;C:\Program Files (x86)\FMOD SoundSystem\FMOD Programmers API Windows\api\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;WIN32;_RETAIL;NDEBUG;_CONSOLE;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<MinimalRebuild>true</MinimalRebuild>
<BufferSecurityCheck>false</BufferSecurityCheck>
</ClCompile>
<Link>
<AdditionalDependencies>./../../Lib/SLikeNet_LibStatic_Retail - Unicode_Win32.lib;Winmm.lib;ws2_32.lib;fmodex_vc.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>C:\Program Files (x86)\FMOD SoundSystem\FMOD Programmers API Windows\api\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>
</Link>
<PostBuildEvent>
<Command>copy "C:\Program Files (x86)\FMOD SoundSystem\FMOD Programmers API Windows\api\fmodex.dll" "$(OutDir)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="FMODVoiceAdapter.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="..\..\DependentExtensions\RakVoice.cpp" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\bits.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\cb_search.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\exc_10_16_table.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\exc_10_32_table.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\exc_20_32_table.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\exc_5_256_table.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\exc_5_64_table.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\exc_8_128_table.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\fftwrap.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\filters.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\gain_table.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\gain_table_lbr.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\hexc_10_32_table.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\hexc_table.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\high_lsp_tables.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\jitter.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\kiss_fft.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\kiss_fftr.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\lbr_48k_tables.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\lpc.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\lsp.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\lsp_tables_nb.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\ltp.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\math_approx.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\mdf.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\misc.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\modes.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\nb_celp.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\preprocess.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\quant_lsp.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\sb_celp.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\smallft.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\speex.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\speex_callbacks.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\speex_header.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\stereo.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\vbr.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\vorbis_psy.c" />
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\vq.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="FMODVoiceAdapter.h" />
<ClInclude Include="..\..\DependentExtensions\RakVoice.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\_kiss_fft_guts.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\arch.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\cb_search.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\cb_search_arm4.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\cb_search_bfin.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\cb_search_sse.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\fftwrap.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\filters.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\filters_arm4.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\filters_bfin.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\filters_sse.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\fixed_arm4.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\fixed_arm5e.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\fixed_bfin.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\fixed_debug.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\fixed_generic.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\kiss_fft.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\kiss_fftr.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\lpc.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\lpc_bfin.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\lsp.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\ltp.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\ltp_arm4.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\ltp_bfin.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\ltp_sse.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\math_approx.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\misc.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\misc_bfin.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\modes.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\nb_celp.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\pseudofloat.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\quant_lsp.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\sb_celp.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\smallft.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\stack_alloc.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\vbr.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\vorbis_psy.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\vq.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\vq_arm4.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\vq_bfin.h" />
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\vq_sse.h" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Lib\LibStatic\LibStatic.vcxproj">
<Project>{6533bdae-0f0c-45e4-8fe7-add0f37fe063}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,275 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Speex">
<UniqueIdentifier>{68ca839a-2142-4b77-9acb-3ca7bf1f7e11}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="FMODVoiceAdapter.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\RakVoice.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\bits.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\cb_search.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\exc_10_16_table.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\exc_10_32_table.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\exc_20_32_table.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\exc_5_256_table.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\exc_5_64_table.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\exc_8_128_table.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\fftwrap.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\filters.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\gain_table.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\gain_table_lbr.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\hexc_10_32_table.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\hexc_table.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\high_lsp_tables.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\jitter.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\kiss_fft.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\kiss_fftr.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\lbr_48k_tables.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\lpc.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\lsp.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\lsp_tables_nb.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\ltp.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\math_approx.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\mdf.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\misc.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\modes.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\nb_celp.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\preprocess.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\quant_lsp.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\sb_celp.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\smallft.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\speex.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\speex_callbacks.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\speex_header.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\stereo.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\vbr.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\vorbis_psy.c">
<Filter>Speex</Filter>
</ClCompile>
<ClCompile Include="..\..\DependentExtensions\speex-1.1.12\libspeex\vq.c">
<Filter>Speex</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="FMODVoiceAdapter.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\RakVoice.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\_kiss_fft_guts.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\arch.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\cb_search.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\cb_search_arm4.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\cb_search_bfin.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\cb_search_sse.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\fftwrap.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\filters.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\filters_arm4.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\filters_bfin.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\filters_sse.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\fixed_arm4.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\fixed_arm5e.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\fixed_bfin.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\fixed_debug.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\fixed_generic.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\kiss_fft.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\kiss_fftr.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\lpc.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\lpc_bfin.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\lsp.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\ltp.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\ltp_arm4.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\ltp_bfin.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\ltp_sse.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\math_approx.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\misc.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\misc_bfin.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\modes.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\nb_celp.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\pseudofloat.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\quant_lsp.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\sb_celp.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\smallft.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\stack_alloc.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\vbr.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\vorbis_psy.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\vq.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\vq_arm4.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\vq_bfin.h">
<Filter>Speex</Filter>
</ClInclude>
<ClInclude Include="..\..\DependentExtensions\speex-1.1.12\libspeex\vq_sse.h">
<Filter>Speex</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@ -0,0 +1,284 @@
/*
* Original work: Copyright (c) 2014, Oculus VR, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* RakNet License.txt file in the licenses directory of this source tree. An additional grant
* of patent rights can be found in the RakNet Patents.txt file in the same directory.
*
*
* Modified work: Copyright (c) 2016-2020, SLikeSoft UG (haftungsbeschränkt)
*
* This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style
* license found in the license.txt file in the root directory of this source tree.
*/
#define INTERACTIVE
#if defined(INTERACTIVE)
#include "slikenet/Kbhit.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#include "slikenet/peerinterface.h"
#include "slikenet/MessageIdentifiers.h"
#include "slikenet/Gets.h"
#include "slikenet/sleep.h"
#include "RakVoice.h"
#include "slikenet/statistics.h"
#include "slikenet/GetTime.h"
#include "slikenet/assert.h"
#include "slikenet/linux_adapter.h"
#include "slikenet/osx_adapter.h"
#include "fmod.hpp"
#include "fmod_errors.h"
#include "FMODVoiceAdapter.h"
#if defined(_PS3) || defined(__PS3__)
#include "Console2Includes.h"
#include "fmodps3.h"
#endif
// Reads and writes per second of the sound data
// Speex only supports these 3 values
#define SAMPLE_RATE (8000)
//#define SAMPLE_RATE (16000)
//#define SAMPLE_RATE (32000)
#define FRAMES_PER_BUFFER (2048 / (32000 / SAMPLE_RATE))
// define sample type. Only short(16 bits sound) is supported at the moment.
typedef short SAMPLE;
SLNet::RakPeerInterface *rakPeer= nullptr;
FMOD::System *fmodSystem= nullptr;
SLNet::RakVoice rakVoice;
bool mute;
void FMOD_ERRCHECK(FMOD_RESULT result)
{
if (result != FMOD_OK)
{
printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result));
#if defined(INTERACTIVE)
system("pause");
#endif
exit(-1);
}
}
struct myStat{
unsigned int time;
unsigned int bitsRec;
unsigned int bitsSent;
};
void LogStats(){
SLNet::RakNetStatistics *rss=rakPeer->GetStatistics(rakPeer->GetSystemAddressFromIndex(0));
char buffer[1024];
StatisticsToString(rss,buffer,1024,1);
printf(buffer);
}
// Prints the current encoder parameters
void PrintParameters(void)
{
printf("\nComplexity=%3d Noise filter=%3s VAD=%3s VBR=%3s\n"
,rakVoice.GetEncoderComplexity()
,(rakVoice.IsNoiseFilterActive()) ? "ON" : "OFF"
,(rakVoice.IsVADActive()) ? "ON" : "OFF"
,(rakVoice.IsVBRActive()) ? "ON" : "OFF");
}
int main(void)
{
FMOD_RESULT result;
unsigned int version;
/*
Create a System object and initialize.
*/
result = FMOD::System_Create(&fmodSystem);
RakAssert(result>=0);
result = fmodSystem->getVersion(&version);
RakAssert(result>=0);
if (version < FMOD_VERSION)
{
printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION);
return -1;
}
// result = fmodSystem->init(100, FMOD_INIT_NORMAL, (void *)&extradriverdata);
result = fmodSystem->init(100, FMOD_INIT_NORMAL, 0);
RakAssert(result>=0);
// ERRCHECK(result);
printf("A sample on how to use RakVoice. You need a microphone for this sample.\n");
printf("RakVoice relies on Speex for voice encoding and decoding.\n");
printf("See DependentExtensions/RakVoice/speex-1.1.12 for speex projects.\n");
printf("For windows, I had to define HAVE_CONFIG_H, include win32/config.h,\n");
printf("and include the files under libspeex, except those that start with test.\n");
printf("Difficulty: Advanced\n\n");
mute=false;
bool quit;
char ch;
char port[256];
rakPeer = SLNet::RakPeerInterface::GetInstance();
#if defined(INTERACTIVE)
printf("Enter local port: ");
Gets(port, sizeof(port));
if (port[0]==0)
#endif
strcpy_s(port, "60000");
SLNet::SocketDescriptor socketDescriptor(atoi(port),0);
rakPeer->Startup(4, &socketDescriptor, 1);
rakPeer->SetMaximumIncomingConnections(4);
rakPeer->AttachPlugin(&rakVoice);
rakVoice.Init(SAMPLE_RATE, FRAMES_PER_BUFFER*sizeof(SAMPLE));
// Initialize our connection with FMOD
if (!SLNet::FMODVoiceAdapter::Instance()->SetupAdapter(fmodSystem, &rakVoice)){
printf("An error occurred while initializing FMOD sounds.\n");
exit(-1);
}
SLNet::Packet *p;
quit=false;
#if defined(INTERACTIVE)
printf("(Q)uit. (C)onnect. (D)isconnect. (M)ute. ' ' for stats.\n");
printf("(+/-)encoder complexity. (N)oise filter on/off. (V)AD on/off. (B)vbr on/off.\n");
#else
rakPeer->Connect("1.1.1.1", 60000, 0,0);
#endif
PrintParameters();
while (!quit)
{
#if defined(INTERACTIVE)
if (_kbhit())
{
ch=_getch();
if (ch=='+'){
// Increase encoder complexity
int v = rakVoice.GetEncoderComplexity();
if (v<10) rakVoice.SetEncoderComplexity(v+1);
PrintParameters();
}
else if (ch=='-'){
// Decrease encoder complexity
int v = rakVoice.GetEncoderComplexity();
if (v>0) rakVoice.SetEncoderComplexity(v-1);
PrintParameters();
}
else if (ch=='n'){
// Turn on/off noise filter
rakVoice.SetNoiseFilter(!rakVoice.IsNoiseFilterActive());
PrintParameters();
}
else if (ch=='v') {
// Turn on/off Voice detection
rakVoice.SetVAD(!rakVoice.IsVADActive());
PrintParameters();
}
else if (ch=='b') {
// Turn on/off VBR
rakVoice.SetVBR(!rakVoice.IsVBRActive());
PrintParameters();
}
else if (ch=='y')
{
quit=true;
}
else if (ch=='c')
{
char ip[256];
printf("\nEnter IP of remote system: ");
Gets(ip, sizeof(ip));
if (ip[0]==0)
strcpy_s(ip, "127.0.0.1");
printf("\nEnter port of remote system: ");
Gets(port, sizeof(port));
if (port[0]==0)
strcpy_s(port, "60000");
rakPeer->Connect(ip, atoi(port), 0,0);
}
else if (ch=='m')
{
mute=!mute;
SLNet::FMODVoiceAdapter::Instance()->SetMute(mute);
if (mute)
printf("\nNow muted.\n");
else
printf("\nNo longer muted.\n");
}
else if (ch=='d')
{
rakPeer->Shutdown(100,0);
}
else if (ch==' ')
{
char message[2048];
SLNet::RakNetStatistics *rss=rakPeer->GetStatistics(rakPeer->GetSystemAddressFromIndex(0));
StatisticsToString(rss, message, 2048, 2);
printf("%s", message);
}
else if (ch=='q')
quit=true;
ch=0;
}
#endif
p=rakPeer->Receive();
while (p)
{
if (p->data[0]==ID_CONNECTION_REQUEST_ACCEPTED)
{
printf("\nID_CONNECTION_REQUEST_ACCEPTED from %s\n", p->systemAddress.ToString());
rakVoice.RequestVoiceChannel(p->guid);
}
else if (p->data[0]==ID_RAKVOICE_OPEN_CHANNEL_REQUEST)
{
printf("\nOpen Channel request from %s\n", p->systemAddress.ToString());
}
else if (p->data[0]==ID_RAKVOICE_OPEN_CHANNEL_REPLY)
{
printf("\nGot new channel from %s\n", p->systemAddress.ToString());
}
rakPeer->DeallocatePacket(p);
p=rakPeer->Receive();
}
fmodSystem->update();
// Update or connection with FMOD
SLNet::FMODVoiceAdapter::Instance()->Update();
// LogStats();
RakSleep(20);
}
// Release any FMOD resources we used, and shutdown FMOD itself
SLNet::FMODVoiceAdapter::Instance()->Release();
fmodSystem->release();
rakPeer->Shutdown(300);
rakPeer->DetachPlugin(&rakVoice);
SLNet::RakPeerInterface::DestroyInstance(rakPeer);
return 0;
}