Skip to content

Commit

Permalink
Fixed broken pipes
Browse files Browse the repository at this point in the history
- Some software, like FFmpeg, will only accept temporary sizes of 0xFFFFFFFF
  • Loading branch information
ScriptTiger committed Oct 9, 2024
1 parent 0732d1b commit d4433cc
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Argument | Description
`-bits <number>` | Bit depth of mix WAV file (16\|24\|32)
`-attenuate` | Attenuate linearly to prevent clipping, dividing by number of tracks mixed

If no output file is given, or `-` is given, the mix is written to standard output with a bit depth of 24 and can be piped into VLC or other compatible media applications.
If no output file is given, or `-` is given, the mix is written to standard output with a bit depth of 24 and can be piped into FFmpeg, FFplay, VLC, or other compatible media applications.

Attenuating linearly is best done when going from source tracks of lower bit depths to mixes of higher bit depths to diminish resolution loss. This will result in an output mix which will always be perceptually "quieter," but still retain better resolution than if it were a mix of the same or lower bit depth as the original tracks. This is because the mix itself, and attenuation division, is performed in 64-bit floating point and results in trailing digits behind a decimal which will be removed when the mix track is truncated to its destination bit depth, of 32 bits or lower, signed and not floating point. So, mixing to higher bit depths than the original will scale some of that data which would otherwise be behind the decimal to in front of the decimal and preserve it in the resulting mix.

Expand Down
11 changes: 11 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
module github.com/ScriptTiger/mixerInG

go 1.23.0

replace github.com/go-audio/wav => github.com/ScriptTiger/wav v0.0.0-20241009130152-f2b055a7031c

require (
github.com/go-audio/audio v1.0.0
github.com/go-audio/wav v0.0.0-20181013172942-de841e69b884
)

require github.com/go-audio/riff v1.0.0 // indirect
7 changes: 7 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
github.com/ScriptTiger/wav v0.0.0-20241009130152-f2b055a7031c h1:VVBkoMERw8nWSNPCXmnK/rA+hKURU7+2gomWDWleLi4=
github.com/ScriptTiger/wav v0.0.0-20241009130152-f2b055a7031c/go.mod h1:bp2870jtp/ixAJLIOdShBfl1WpyLGDZ57jnVWMgkgIc=
github.com/go-audio/aiff v1.0.0/go.mod h1:Kazp+9JR/Y1ITCXaDlO6OIIOrz6eGGAn+dGT04V4HPM=
github.com/go-audio/audio v1.0.0 h1:zS9vebldgbQqktK4H0lUqWrG8P0NxCJVqcj7ZpNnwd4=
github.com/go-audio/audio v1.0.0/go.mod h1:6uAu0+H2lHkwdGsAY+j2wHPNPpPoeg5AaEFh9FlA+Zs=
github.com/go-audio/riff v1.0.0 h1:d8iCGbDvox9BfLagY94fBynxSPHO80LmZCaOsmKxokA=
github.com/go-audio/riff v1.0.0/go.mod h1:l3cQwc85y79NQFCRB7TiPoNiaijp6q8Z0Uv38rVG498=
17 changes: 1 addition & 16 deletions ref/Build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,6 @@
set APP=mixerInG
if not exist "Release" md "Release"

cd ..

if not exist go.sum (
echo Initializing go.mod...
go mod init github.com/ScriptTiger/%APP% 2> nul
go mod tidy 2> nul
)

cd ref

choice /m "Dev build?"
if %errorlevel% == 1 (set dev=1) else set dev=0

Expand All @@ -25,12 +15,7 @@ set GOARCH=386
call :Build_OS

:Exit
choice /m "Clean up go.mod before exiting?"
if %errorlevel% == 1 (
cd ..
del go.sum
echo module github.com/ScriptTiger/%APP%>go.mod
)
pause
exit /b

:Build_OS
Expand Down

0 comments on commit d4433cc

Please sign in to comment.