Skip to content

Commit

Permalink
Support reading FLAC files
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocobo1 committed Jul 12, 2017
1 parent f0af38b commit 6304043
Show file tree
Hide file tree
Showing 9 changed files with 331 additions and 1 deletion.
20 changes: 20 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ environment:
OPUS_MSBUILD_CMD_X86: /maxcpucount /property:Configuration=Release,Platform=Win32 /target:opus
OPUS_MSBUILD_CMD_X64: /maxcpucount /property:Configuration=Release,Platform=x64 /target:opus

NASM_URL: http://www.nasm.us/pub/nasm/releasebuilds/2.13.01/win64/nasm-2.13.01-win64.zip

FLAC_SOL_FILE: libFLAC_static.sln
FLAC_MSBUILD_CMD_X86: /maxcpucount /property:Configuration=Release,Platform=x86
FLAC_MSBUILD_CMD_X64: /maxcpucount /property:Configuration=Release,Platform=x64

OPUS-TOOLS_SOL_FILE: opus-tools.sln
OPUS-TOOLS_MSBUILD_CMD_X86: /maxcpucount /property:Configuration=Release,Platform=Win32
OPUS-TOOLS_MSBUILD_CMD_X64: /maxcpucount /property:Configuration=Release,Platform=x64
Expand Down Expand Up @@ -74,6 +80,20 @@ before_build:
- msbuild "lib\opus\win32\VS2015\%OPUS_SOL_FILE%" %OPUS_MSBUILD_CMD_X86%
- msbuild "lib\opus\win32\VS2015\%OPUS_SOL_FILE%" %OPUS_MSBUILD_CMD_X64%

# install NASM
- cd \
- appveyor DownloadFile "%NASM_URL%" -FileName "c:\nasm.zip"
- 7z x "nasm.zip" > nul
- move nasm-* NASM
- set PATH=%PATH%;c:\NASM;
- nasm -v

# prepare flac
- cd "%REPO_DIR%"
- move /Y "src\flac\libFLAC\*" "lib\flac\src\libFLAC"
- msbuild "lib\flac\src\libFLAC\%FLAC_SOL_FILE%" %FLAC_MSBUILD_CMD_X86%
- msbuild "lib\flac\src\libFLAC\%FLAC_SOL_FILE%" %FLAC_MSBUILD_CMD_X64%

# to run your custom scripts instead of automatic MSBuild
build_script:
- cd "%REPO_DIR%"
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "libogg"]
path = lib/libogg
url = https://git.xiph.org/ogg.git
[submodule "lib/flac"]
path = lib/flac
url = https://git.xiph.org/flac.git
1 change: 1 addition & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
| [opus-tools](https://git.xiph.org/?p=opus-tools.git), [(mirror)](https://github.com/xiph/opus-tools) | git master |
| [opus](https://git.xiph.org/?p=opus.git), [(mirror)](https://github.com/xiph/opus) | Latest stable release |
| [ogg](https://git.xiph.org/?p=ogg.git), [(mirror)](https://github.com/xiph/ogg) | git master |
| [flac](https://git.xiph.org/?p=flac.git), [(mirror)](https://github.com/xiph/flac) | git master |


### [Download page](https://github.com/Chocobo1/opus-tools_win32-build/releases)
1 change: 1 addition & 0 deletions lib/flac
Submodule flac added at 68c588
28 changes: 28 additions & 0 deletions src/flac/libFLAC/libFLAC_static.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26228.4
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libFLAC_static", "libFLAC_static.vcxproj", "{4CEFBC84-C215-11DB-8314-0800200C9A66}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4CEFBC84-C215-11DB-8314-0800200C9A66}.Debug|x64.ActiveCfg = Debug|x64
{4CEFBC84-C215-11DB-8314-0800200C9A66}.Debug|x64.Build.0 = Debug|x64
{4CEFBC84-C215-11DB-8314-0800200C9A66}.Debug|x86.ActiveCfg = Debug|Win32
{4CEFBC84-C215-11DB-8314-0800200C9A66}.Debug|x86.Build.0 = Debug|Win32
{4CEFBC84-C215-11DB-8314-0800200C9A66}.Release|x64.ActiveCfg = Release|x64
{4CEFBC84-C215-11DB-8314-0800200C9A66}.Release|x64.Build.0 = Release|x64
{4CEFBC84-C215-11DB-8314-0800200C9A66}.Release|x86.ActiveCfg = Release|Win32
{4CEFBC84-C215-11DB-8314-0800200C9A66}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
267 changes: 267 additions & 0 deletions src/flac/libFLAC/libFLAC_static.vcxproj

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions src/opus-tools/VS2015/opusenc.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,24 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalOptions>/Gw %(AdditionalOptions)</AdditionalOptions>
<AdditionalIncludeDirectories>..\..\..\flac\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>HAVE_LIBFLAC;FLAC_API_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalDependencies>libFLAC_static.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\flac\src\libFLAC\Release\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalOptions>/Gw %(AdditionalOptions)</AdditionalOptions>
<AdditionalIncludeDirectories>..\..\..\flac\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>HAVE_LIBFLAC;FLAC_API_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<LinkTimeCodeGeneration>PGOptimization</LinkTimeCodeGeneration>
<AdditionalDependencies>libFLAC_static.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\flac\src\libFLAC\x64\Release\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
Expand Down
Binary file modified src/opus-tools/opusenc.pgd
Binary file not shown.
2 changes: 1 addition & 1 deletion src/opus-tools/run_pgo.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ opusenc.exe --bitrate 32 --vbr --comp 10 --quiet in.wav - > nul
opusenc.exe --bitrate 64 --vbr --comp 10 --quiet in.wav - > nul
opusenc.exe --bitrate 96 --vbr --comp 10 --quiet in.wav - > nul
opusenc.exe --bitrate 128 --vbr --comp 10 --quiet in.wav - > nul
opusenc.exe --bitrate 160 --vbr --comp 10 --quiet in.wav - > nul
opusenc.exe --bitrate 160 --vbr --comp 10 --quiet in.flac - > nul

rem pgomgr /merge opusenc.pgd

0 comments on commit 6304043

Please sign in to comment.