diff --git a/code/nel/src/sound/audio_mixer_user.cpp b/code/nel/src/sound/audio_mixer_user.cpp index 23f72644c..fdc6f6e11 100644 --- a/code/nel/src/sound/audio_mixer_user.cpp +++ b/code/nel/src/sound/audio_mixer_user.cpp @@ -768,8 +768,11 @@ std::string UAudioMixer::buildSampleBank(const std::vector &sampleL } // Sample number MUST be even - nlassert(mono16Data.size() == (mono16Data.size() & 0xfffffffe)); - nlassert(adpcmData.size() == mono16Data.size() / 2); + // nlassert(mono16Data.size() == (mono16Data.size() & 0xfffffffe)); + if (mono16Data.size() & 1) + nlwarning("Uneven sample numbers, ADPCM will miss a sample. File: %s, Samples: %i, ADPCM Size: %i", + sampleList[j].c_str(), (int)mono16Data.size(), (int)adpcmData.size()); + nlassert(adpcmData.size() == (mono16Data.size() >> 1)); adpcmBuffers[j].swap(adpcmData); mono16Buffers[j].swap(mono16Data); diff --git a/code/nel/tools/build_gamedata/0_setup.py b/code/nel/tools/build_gamedata/0_setup.py index 8eff34131..479121428 100755 --- a/code/nel/tools/build_gamedata/0_setup.py +++ b/code/nel/tools/build_gamedata/0_setup.py @@ -83,6 +83,18 @@ if not args.noconf: DatabaseDirectory except NameError: DatabaseDirectory = "W:/database" + try: + SoundDirectory + except NameError: + SoundDirectory = "V:" + try: + SoundSheetsDirectory + except NameError: + SoundSheetsDirectory = "V:" + try: + SoundSheetsDfnDirectory + except NameError: + SoundSheetsDfnDirectory = "V:/DFN" try: ExportBuildDirectory except NameError: @@ -218,6 +230,9 @@ if not args.noconf: ScriptDirectory = askVar(log, "[IN] Script Directory", os.getcwd().replace("\\", "/")).replace("\\", "/") WorkspaceDirectory = askVar(log, "[IN] Workspace Directory", WorkspaceDirectory).replace("\\", "/") DatabaseDirectory = askVar(log, "[IN] Database Directory", DatabaseDirectory).replace("\\", "/") + SoundDirectory = askVar(log, "[IN] Sound Directory", SoundDirectory).replace("\\", "/") + SoundSheetsDirectory = askVar(log, "[IN] Sound Sheets Directory", SoundSheetsDirectory).replace("\\", "/") + SoundSheetsDfnDirectory = askVar(log, "[IN] Sound Sheets DFN Directory", SoundSheetsDfnDirectory).replace("\\", "/") ExportBuildDirectory = askVar(log, "[OUT] Export Build Directory", ExportBuildDirectory).replace("\\", "/") InstallDirectory = askVar(log, "[OUT] Install Directory", InstallDirectory).replace("\\", "/") ClientDevDirectory = askVar(log, "[OUT] Client Dev Directory", ClientDevDirectory).replace("\\", "/") @@ -301,6 +316,9 @@ if not args.noconf: sf.write("\n") sf.write("# Data build directories\n") sf.write("DatabaseDirectory = \"" + str(DatabaseDirectory) + "\"\n") + sf.write("SoundDirectory = \"" + str(SoundDirectory) + "\"\n") + sf.write("SoundSheetsDirectory = \"" + str(SoundSheetsDirectory) + "\"\n") + sf.write("SoundSheetsDfnDirectory = \"" + str(SoundSheetsDfnDirectory) + "\"\n") sf.write("ExportBuildDirectory = \"" + str(ExportBuildDirectory) + "\"\n") sf.write("\n") sf.write("# Install directories\n") @@ -415,6 +433,9 @@ if not args.noverify: findTool(log, ToolDirectories, MakeSheetIdTool, ToolSuffix) # findTool(log, ToolDirectories, BuildSheetsTool, ToolSuffix) # kaetemi stuff, ignore this # findTool(log, ToolDirectories, BuildSoundTool, ToolSuffix) # kaetemi stuff, ignore this + # findTool(log, ToolDirectories, BuildSoundTool, ToolSuffix) + findTool(log, ToolDirectories, BuildSoundbankTool, ToolSuffix) + findTool(log, ToolDirectories, BuildSamplebankTool, ToolSuffix) findTool(log, ToolDirectories, BuildCoarseMeshTool, ToolSuffix) findTool(log, ToolDirectories, LightmapOptimizerTool, ToolSuffix) findTool(log, ToolDirectories, BuildClodtexTool, ToolSuffix) diff --git a/code/nel/tools/build_gamedata/configuration/tools.py b/code/nel/tools/build_gamedata/configuration/tools.py index c0c962360..67cefdd5b 100755 --- a/code/nel/tools/build_gamedata/configuration/tools.py +++ b/code/nel/tools/build_gamedata/configuration/tools.py @@ -73,6 +73,9 @@ TileEditTool = "tile_edit" MakeSheetIdTool = "make_sheet_id" # BuildSheetsTool = "th_build_sheets" # kaetemi stuff, ignore this # BuildSoundTool = "th_build_sound" # kaetemi stuff, ignore this +# BuildSoundTool = "build_sound" +BuildSoundbankTool = "build_soundbank" +BuildSamplebankTool = "build_samplebank" BuildCoarseMeshTool = "build_coarse_mesh" LightmapOptimizerTool = "lightmap_optimizer" BuildClodtexTool = "build_clodtex" diff --git a/code/nel/tools/build_gamedata/processes/sound/0_setup.py b/code/nel/tools/build_gamedata/processes/samplebank/0_setup.py old mode 100755 new mode 100644 similarity index 81% rename from code/nel/tools/build_gamedata/processes/sound/0_setup.py rename to code/nel/tools/build_gamedata/processes/samplebank/0_setup.py index 178a810ae..0c9c6c856 --- a/code/nel/tools/build_gamedata/processes/sound/0_setup.py +++ b/code/nel/tools/build_gamedata/processes/samplebank/0_setup.py @@ -1,11 +1,11 @@ #!/usr/bin/python # # \file 0_setup.py -# \brief Setup sound +# \brief Setup samplebank # \date 2009-06-03 10:47GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. -# Setup sound +# Setup samplebank # # NeL - MMORPG Framework # Copyright (C) 2009-2014 by authors @@ -38,29 +38,25 @@ from directories import * printLog(log, "") printLog(log, "-------") -printLog(log, "--- Setup sound") +printLog(log, "--- Setup samplebank") printLog(log, "-------") printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") # Setup source directories printLog(log, ">>> Setup source directories <<<") -mkPath(log, LeveldesignDirectory) -mkPath(log, LeveldesignDfnDirectory) -mkPath(log, DatabaseDirectory + "/" + SoundSamplebanksSourceDirectory) +mkPath(log, SoundDirectory + "/" + SoundSamplebanksSourceDirectory) # Setup export directories printLog(log, ">>> Setup export directories <<<") # Setup build directories printLog(log, ">>> Setup build directories <<<") -mkPath(log, ExportBuildDirectory + "/" + SoundSheetsBuildDirectory) mkPath(log, ExportBuildDirectory + "/" + SoundSamplebanksBuildDirectory) # Setup client directories printLog(log, ">>> Setup client directories <<<") -mkPath(log, InstallDirectory + "/" + SoundSheetsInstallDirectory) -mkPath(log, InstallDirectory + "/" + SoundSamplebanksInstallDirectory) +mkPath(log, InstallDirectory + "/" + SoundInstallDirectory) log.close() diff --git a/code/nel/tools/build_gamedata/processes/sound/1_export.py b/code/nel/tools/build_gamedata/processes/samplebank/1_export.py old mode 100755 new mode 100644 similarity index 94% rename from code/nel/tools/build_gamedata/processes/sound/1_export.py rename to code/nel/tools/build_gamedata/processes/samplebank/1_export.py index 4fd98abb4..9760458b9 --- a/code/nel/tools/build_gamedata/processes/sound/1_export.py +++ b/code/nel/tools/build_gamedata/processes/samplebank/1_export.py @@ -1,11 +1,11 @@ #!/usr/bin/python # # \file 1_export.py -# \brief Export sound +# \brief Export samplebank # \date 2009-06-03 10:47GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. -# Export sound +# Export samplebank # # NeL - MMORPG Framework # Copyright (C) 2009-2014 by authors @@ -38,7 +38,7 @@ from directories import * printLog(log, "") printLog(log, "-------") -printLog(log, "--- Export sound") +printLog(log, "--- Export samplebank") printLog(log, "-------") printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") diff --git a/code/nel/tools/build_gamedata/processes/sound/2_build.py b/code/nel/tools/build_gamedata/processes/samplebank/2_build.py old mode 100755 new mode 100644 similarity index 59% rename from code/nel/tools/build_gamedata/processes/sound/2_build.py rename to code/nel/tools/build_gamedata/processes/samplebank/2_build.py index 56abeedd7..447edd468 --- a/code/nel/tools/build_gamedata/processes/sound/2_build.py +++ b/code/nel/tools/build_gamedata/processes/samplebank/2_build.py @@ -1,11 +1,11 @@ #!/usr/bin/python # # \file 2_build.py -# \brief Build sound +# \brief Build samplebank # \date 2009-06-03 10:47GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. -# Build sound +# Build samplebank # # NeL - MMORPG Framework # Copyright (C) 2009-2014 by authors @@ -38,28 +38,33 @@ from directories import * printLog(log, "") printLog(log, "-------") -printLog(log, "--- Build sound") +printLog(log, "--- Build samplebank") printLog(log, "-------") printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") # Find tools -BuildSound = findTool(log, ToolDirectories, BuildSoundTool, ToolSuffix) +BuildSamplebank = findTool(log, ToolDirectories, BuildSamplebankTool, ToolSuffix) printLog(log, "") -# For each sound directory -printLog(log, ">>> Build sound <<<") -if BuildSound == "": - toolLogFail(log, BuildSoundTool, ToolSuffix) +# For each samplebank directory +printLog(log, ">>> Build samplebank <<<") +if BuildSamplebank == "": + toolLogFail(log, BuildSamplebankTool, ToolSuffix) else: - mkPath(log, LeveldesignDirectory) - mkPath(log, LeveldesignDfnDirectory) - mkPath(log, DatabaseDirectory + "/" + SoundSamplebanksSourceDirectory) - mkPath(log, ExportBuildDirectory + "/" + SoundSheetsBuildDirectory) - mkPath(log, ExportBuildDirectory + "/" + SoundSamplebanksBuildDirectory) - subprocess.call([ BuildSound, LeveldesignDirectory, LeveldesignDfnDirectory, DatabaseDirectory + "/" + SoundSamplebanksSourceDirectory, ExportBuildDirectory + "/" + SoundSheetsBuildDirectory ]) - moveFilesExtNoTree(log, DatabaseDirectory + "/" + SoundSamplebanksSourceDirectory, ExportBuildDirectory + "/" + SoundSamplebanksBuildDirectory, ".sample_bank") -printLog(log, "") + sourcePath = SoundDirectory + "/" + SoundSamplebanksSourceDirectory + buildPath = ExportBuildDirectory + "/" + SoundSamplebanksBuildDirectory + mkPath(log, sourcePath) + mkPath(log, buildPath) + for dir in os.listdir(sourcePath): + dirPath = sourcePath + "/" + dir + if (os.path.isdir(dirPath)) and dir != ".svn" and dir != "*.*": + samplebankPath = buildPath + "/" + dir + ".sample_bank" + if needUpdateDirNoSubdirFile(log, dirPath, samplebankPath): + # build_samplebank + subprocess.call([ BuildSamplebank, dirPath, buildPath, dir ]) + else: + printLog(log, "SKIP " + samplebankPath) log.close() diff --git a/code/nel/tools/build_gamedata/processes/sound/3_install.py b/code/nel/tools/build_gamedata/processes/samplebank/3_install.py old mode 100755 new mode 100644 similarity index 70% rename from code/nel/tools/build_gamedata/processes/sound/3_install.py rename to code/nel/tools/build_gamedata/processes/samplebank/3_install.py index dc32c30e1..104f76681 --- a/code/nel/tools/build_gamedata/processes/sound/3_install.py +++ b/code/nel/tools/build_gamedata/processes/samplebank/3_install.py @@ -1,11 +1,11 @@ #!/usr/bin/python # # \file 3_install.py -# \brief Install sound +# \brief Install samplebank # \date 2009-06-03 10:47GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. -# Install sound +# Install samplebank # # NeL - MMORPG Framework # Copyright (C) 2009-2014 by authors @@ -38,20 +38,15 @@ from directories import * printLog(log, "") printLog(log, "-------") -printLog(log, "--- Install sound") +printLog(log, "--- Install samplebank") printLog(log, "-------") printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) printLog(log, "") -printLog(log, ">>> Install sound packed_sheets <<<") -mkPath(log, ExportBuildDirectory + "/" + SoundSheetsBuildDirectory) -mkPath(log, InstallDirectory + "/" + SoundSheetsInstallDirectory) -copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + SoundSheetsBuildDirectory, InstallDirectory + "/" + SoundSheetsInstallDirectory, ".packed_sheets") - -printLog(log, ">>> Install sound samplebanks <<<") +printLog(log, ">>> Install samplebank <<<") mkPath(log, ExportBuildDirectory + "/" + SoundSamplebanksBuildDirectory) -mkPath(log, InstallDirectory + "/" + SoundSamplebanksInstallDirectory) -copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + SoundSamplebanksBuildDirectory, InstallDirectory + "/" + SoundSamplebanksInstallDirectory, ".sample_bank") +mkPath(log, InstallDirectory + "/" + SoundInstallDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + SoundSamplebanksBuildDirectory, InstallDirectory + "/" + SoundInstallDirectory, ".sample_bank") printLog(log, "") log.close() diff --git a/code/nel/tools/sound/build_sound/build_sound.cpp b/code/nel/tools/sound/build_sound/build_sound.cpp index dbb47dd02..bacdf7664 100644 --- a/code/nel/tools/sound/build_sound/build_sound.cpp +++ b/code/nel/tools/sound/build_sound/build_sound.cpp @@ -56,6 +56,10 @@ namespace { // your build script system. // //////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////// +// this tool is deprecated by build_samplebank and build_soundbank // +///////////////////////////////////////////////////////////////////// + int main(int nNbArg, char **ppArgs) { // create debug stuff