diff --git a/.envrc b/.envrc old mode 100644 new mode 100755 diff --git a/.github/ISSUE_TEMPLATE b/.github/ISSUE_TEMPLATE old mode 100644 new mode 100755 diff --git a/.github/PULL_REQUEST_TEMPLATE b/.github/PULL_REQUEST_TEMPLATE old mode 100644 new mode 100755 diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/CHANGELOG.md b/CHANGELOG.md old mode 100644 new mode 100755 diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/Makefile b/Makefile old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 index a35bd98..2ff27b0 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ If you're not familiar with Windows Core Audio API, visit the MSDN. ## Prerequisites -- Go 1.13 or later +- Go 1.17 or later ## Usage diff --git a/TODO.md b/TODO.md old mode 100644 new mode 100755 diff --git a/_example/CaptureSharedEventDriven/.envrc b/_example/CaptureSharedEventDriven/.envrc old mode 100644 new mode 100755 diff --git a/_example/CaptureSharedEventDriven/.gitignore b/_example/CaptureSharedEventDriven/.gitignore old mode 100644 new mode 100755 diff --git a/_example/CaptureSharedEventDriven/LICENSE b/_example/CaptureSharedEventDriven/LICENSE old mode 100644 new mode 100755 diff --git a/_example/CaptureSharedEventDriven/README.md b/_example/CaptureSharedEventDriven/README.md old mode 100644 new mode 100755 index 2a10952..2155cbf --- a/_example/CaptureSharedEventDriven/README.md +++ b/_example/CaptureSharedEventDriven/README.md @@ -4,7 +4,7 @@ This example shows that the capturing audio with shared event driven mode. ## Prerequisites -- Go 1.13 or later +- Go 1.17 or later ## Build diff --git a/_example/CaptureSharedEventDriven/go.mod b/_example/CaptureSharedEventDriven/go.mod old mode 100644 new mode 100755 index dbe8466..342df7d --- a/_example/CaptureSharedEventDriven/go.mod +++ b/_example/CaptureSharedEventDriven/go.mod @@ -1,9 +1,9 @@ module CaptureSharedEventDriven -go 1.13 +go 1.17 require ( - github.com/go-ole/go-ole v1.2.6 + github.com/go-ole/go-ole v1.3.0 github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba github.com/moutend/go-wca v0.3.0 ) diff --git a/_example/CaptureSharedEventDriven/go.sum b/_example/CaptureSharedEventDriven/go.sum old mode 100644 new mode 100755 index 6f455d2..34edec5 --- a/_example/CaptureSharedEventDriven/go.sum +++ b/_example/CaptureSharedEventDriven/go.sum @@ -1,8 +1,12 @@ github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba h1:OjLj0dIkgDrGzgLHh2dv2BGtpa8RwCqykn2ThFcOMLc= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba/go.mod h1:y/Ls9PBADL6vJfbt4gZbNtUS2grnEGnFg4RMsCa5g/4= github.com/moutend/go-wca v0.3.0 h1:IzhsQ44zBzMdT42xlBjiLSVya9cPYOoKx9E+yXVhFo8= github.com/moutend/go-wca v0.3.0/go.mod h1:7VrPO512jnjFGJ6rr+zOoCfiYjOHRPNfbttJuxAurcw= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 h1:7TYNF4UdlohbFwpNH04CoPMp1cHUZgO1Ebq5r2hIjfo= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/_example/CaptureSharedEventDriven/main.go b/_example/CaptureSharedEventDriven/main.go old mode 100644 new mode 100755 diff --git a/_example/CaptureSharedTimerDriven/.envrc b/_example/CaptureSharedTimerDriven/.envrc old mode 100644 new mode 100755 diff --git a/_example/CaptureSharedTimerDriven/.gitignore b/_example/CaptureSharedTimerDriven/.gitignore old mode 100644 new mode 100755 diff --git a/_example/CaptureSharedTimerDriven/LICENSE b/_example/CaptureSharedTimerDriven/LICENSE old mode 100644 new mode 100755 diff --git a/_example/CaptureSharedTimerDriven/README.md b/_example/CaptureSharedTimerDriven/README.md old mode 100644 new mode 100755 index 5f34a45..b66e644 --- a/_example/CaptureSharedTimerDriven/README.md +++ b/_example/CaptureSharedTimerDriven/README.md @@ -4,7 +4,7 @@ This example shows that the capturing audio with shared timer driven mode. ## Prerequisites -- Go 1.13 or later +- Go 1.17 or later ## Build diff --git a/_example/CaptureSharedTimerDriven/go.mod b/_example/CaptureSharedTimerDriven/go.mod old mode 100644 new mode 100755 index c637851..5b9db77 --- a/_example/CaptureSharedTimerDriven/go.mod +++ b/_example/CaptureSharedTimerDriven/go.mod @@ -1,9 +1,9 @@ module CaptureSharedTimerDriven -go 1.13 +go 1.17 require ( - github.com/go-ole/go-ole v1.2.6 + github.com/go-ole/go-ole v1.3.0 github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba github.com/moutend/go-wca v0.3.0 ) diff --git a/_example/CaptureSharedTimerDriven/go.sum b/_example/CaptureSharedTimerDriven/go.sum old mode 100644 new mode 100755 index 6f455d2..34edec5 --- a/_example/CaptureSharedTimerDriven/go.sum +++ b/_example/CaptureSharedTimerDriven/go.sum @@ -1,8 +1,12 @@ github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba h1:OjLj0dIkgDrGzgLHh2dv2BGtpa8RwCqykn2ThFcOMLc= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba/go.mod h1:y/Ls9PBADL6vJfbt4gZbNtUS2grnEGnFg4RMsCa5g/4= github.com/moutend/go-wca v0.3.0 h1:IzhsQ44zBzMdT42xlBjiLSVya9cPYOoKx9E+yXVhFo8= github.com/moutend/go-wca v0.3.0/go.mod h1:7VrPO512jnjFGJ6rr+zOoCfiYjOHRPNfbttJuxAurcw= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 h1:7TYNF4UdlohbFwpNH04CoPMp1cHUZgO1Ebq5r2hIjfo= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/_example/CaptureSharedTimerDriven/main.go b/_example/CaptureSharedTimerDriven/main.go old mode 100644 new mode 100755 diff --git a/_example/DeviceEvents/.envrc b/_example/DeviceEvents/.envrc old mode 100644 new mode 100755 diff --git a/_example/DeviceEvents/.gitignore b/_example/DeviceEvents/.gitignore old mode 100644 new mode 100755 diff --git a/_example/DeviceEvents/LICENSE b/_example/DeviceEvents/LICENSE old mode 100644 new mode 100755 diff --git a/_example/DeviceEvents/README.md b/_example/DeviceEvents/README.md old mode 100644 new mode 100755 index 0721438..67c4660 --- a/_example/DeviceEvents/README.md +++ b/_example/DeviceEvents/README.md @@ -4,7 +4,7 @@ This example shows how to hook audio device events. ## Prerequisites -- Go 1.13 or later +- Go 1.17 or later - `go-ole` (https://github.com/go-ole/go-ole) ## Build diff --git a/_example/DeviceEvents/go.mod b/_example/DeviceEvents/go.mod old mode 100644 new mode 100755 index 8fab2d2..82603bf --- a/_example/DeviceEvents/go.mod +++ b/_example/DeviceEvents/go.mod @@ -1,8 +1,8 @@ module DeviceEvents -go 1.13 +go 1.17 require ( - github.com/go-ole/go-ole v1.2.6 + github.com/go-ole/go-ole v1.3.0 github.com/moutend/go-wca v0.3.0 ) diff --git a/_example/DeviceEvents/go.sum b/_example/DeviceEvents/go.sum old mode 100644 new mode 100755 index bcc9be4..276d99d --- a/_example/DeviceEvents/go.sum +++ b/_example/DeviceEvents/go.sum @@ -1,6 +1,10 @@ github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/moutend/go-wca v0.3.0 h1:IzhsQ44zBzMdT42xlBjiLSVya9cPYOoKx9E+yXVhFo8= github.com/moutend/go-wca v0.3.0/go.mod h1:7VrPO512jnjFGJ6rr+zOoCfiYjOHRPNfbttJuxAurcw= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 h1:7TYNF4UdlohbFwpNH04CoPMp1cHUZgO1Ebq5r2hIjfo= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/_example/DeviceEvents/main.go b/_example/DeviceEvents/main.go old mode 100644 new mode 100755 diff --git a/_example/EndpointVolume/.envrc b/_example/EndpointVolume/.envrc old mode 100644 new mode 100755 diff --git a/_example/EndpointVolume/.gitignore b/_example/EndpointVolume/.gitignore old mode 100644 new mode 100755 diff --git a/_example/EndpointVolume/LICENSE b/_example/EndpointVolume/LICENSE old mode 100644 new mode 100755 diff --git a/_example/EndpointVolume/README.md b/_example/EndpointVolume/README.md old mode 100644 new mode 100755 index bad89f1..4355672 --- a/_example/EndpointVolume/README.md +++ b/_example/EndpointVolume/README.md @@ -4,7 +4,7 @@ This example shows that changing volume for default rendering device. ## Prerequisites -- Go 1.13 or later +- Go 1.17 or later ## Build diff --git a/_example/EndpointVolume/go.mod b/_example/EndpointVolume/go.mod old mode 100644 new mode 100755 index a8c52ee..e289832 --- a/_example/EndpointVolume/go.mod +++ b/_example/EndpointVolume/go.mod @@ -1,8 +1,10 @@ module EndpointVolume -go 1.13 +go 1.17 require ( - github.com/go-ole/go-ole v1.2.6 - github.com/moutend/go-wca v0.3.0 + github.com/cruffinoni/go-wca v0.0.1 + github.com/go-ole/go-ole v1.3.0 ) + +require golang.org/x/sys v0.21.0 // indirect diff --git a/_example/EndpointVolume/go.sum b/_example/EndpointVolume/go.sum old mode 100644 new mode 100755 index bcc9be4..74d53c2 --- a/_example/EndpointVolume/go.sum +++ b/_example/EndpointVolume/go.sum @@ -1,6 +1,7 @@ -github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= -github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/moutend/go-wca v0.3.0 h1:IzhsQ44zBzMdT42xlBjiLSVya9cPYOoKx9E+yXVhFo8= -github.com/moutend/go-wca v0.3.0/go.mod h1:7VrPO512jnjFGJ6rr+zOoCfiYjOHRPNfbttJuxAurcw= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 h1:7TYNF4UdlohbFwpNH04CoPMp1cHUZgO1Ebq5r2hIjfo= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +github.com/cruffinoni/go-wca v0.0.1 h1:5OjPUfgKCxBAp0Gijiw8kva3dBu8SV5eWf8lQ0kZhsc= +github.com/cruffinoni/go-wca v0.0.1/go.mod h1:07Mt2ujfO1Kwa1doIZNMJOlD64hMHIGDYAxHBg9Ml5k= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= diff --git a/_example/EndpointVolume/main.go b/_example/EndpointVolume/main.go old mode 100644 new mode 100755 index 4c3fae6..7ed3457 --- a/_example/EndpointVolume/main.go +++ b/_example/EndpointVolume/main.go @@ -7,8 +7,8 @@ import ( "os" "strconv" + "github.com/cruffinoni/go-wca/pkg/wca" "github.com/go-ole/go-ole" - "github.com/moutend/go-wca/pkg/wca" ) var version = "latest" @@ -31,7 +31,7 @@ func (f *GainFlag) Set(value string) (err error) { f.IsSet = true return } -func (f GainFlag) String() string { +func (f *GainFlag) String() string { return fmt.Sprintf("%v", f.Value) } diff --git a/_example/LoopbackCaptureSharedEventDriven/.envrc b/_example/LoopbackCaptureSharedEventDriven/.envrc old mode 100644 new mode 100755 diff --git a/_example/LoopbackCaptureSharedEventDriven/.gitignore b/_example/LoopbackCaptureSharedEventDriven/.gitignore old mode 100644 new mode 100755 diff --git a/_example/LoopbackCaptureSharedEventDriven/LICENSE b/_example/LoopbackCaptureSharedEventDriven/LICENSE old mode 100644 new mode 100755 diff --git a/_example/LoopbackCaptureSharedEventDriven/README.md b/_example/LoopbackCaptureSharedEventDriven/README.md old mode 100644 new mode 100755 index 9250c89..15518cb --- a/_example/LoopbackCaptureSharedEventDriven/README.md +++ b/_example/LoopbackCaptureSharedEventDriven/README.md @@ -4,7 +4,7 @@ This example shows that the loopback (a.k.a. what you hear) capturing with share ## Prerequisites -- Go 1.13 or later +- Go 1.17 or later ## Build diff --git a/_example/LoopbackCaptureSharedEventDriven/go.mod b/_example/LoopbackCaptureSharedEventDriven/go.mod old mode 100644 new mode 100755 index 4137f5e..caacd1c --- a/_example/LoopbackCaptureSharedEventDriven/go.mod +++ b/_example/LoopbackCaptureSharedEventDriven/go.mod @@ -1,9 +1,9 @@ module LoopbackCaptureSharedEventDriven -go 1.13 +go 1.17 require ( - github.com/go-ole/go-ole v1.2.6 + github.com/go-ole/go-ole v1.3.0 github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba github.com/moutend/go-wca v0.3.0 ) diff --git a/_example/LoopbackCaptureSharedEventDriven/go.sum b/_example/LoopbackCaptureSharedEventDriven/go.sum old mode 100644 new mode 100755 index 6f455d2..34edec5 --- a/_example/LoopbackCaptureSharedEventDriven/go.sum +++ b/_example/LoopbackCaptureSharedEventDriven/go.sum @@ -1,8 +1,12 @@ github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba h1:OjLj0dIkgDrGzgLHh2dv2BGtpa8RwCqykn2ThFcOMLc= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba/go.mod h1:y/Ls9PBADL6vJfbt4gZbNtUS2grnEGnFg4RMsCa5g/4= github.com/moutend/go-wca v0.3.0 h1:IzhsQ44zBzMdT42xlBjiLSVya9cPYOoKx9E+yXVhFo8= github.com/moutend/go-wca v0.3.0/go.mod h1:7VrPO512jnjFGJ6rr+zOoCfiYjOHRPNfbttJuxAurcw= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 h1:7TYNF4UdlohbFwpNH04CoPMp1cHUZgO1Ebq5r2hIjfo= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/_example/LoopbackCaptureSharedEventDriven/main.go b/_example/LoopbackCaptureSharedEventDriven/main.go old mode 100644 new mode 100755 diff --git a/_example/LoopbackCaptureSharedTimerDriven/.envrc b/_example/LoopbackCaptureSharedTimerDriven/.envrc old mode 100644 new mode 100755 diff --git a/_example/LoopbackCaptureSharedTimerDriven/.gitignore b/_example/LoopbackCaptureSharedTimerDriven/.gitignore old mode 100644 new mode 100755 diff --git a/_example/LoopbackCaptureSharedTimerDriven/LICENSE b/_example/LoopbackCaptureSharedTimerDriven/LICENSE old mode 100644 new mode 100755 diff --git a/_example/LoopbackCaptureSharedTimerDriven/README.md b/_example/LoopbackCaptureSharedTimerDriven/README.md old mode 100644 new mode 100755 index b44be5d..45d1e4b --- a/_example/LoopbackCaptureSharedTimerDriven/README.md +++ b/_example/LoopbackCaptureSharedTimerDriven/README.md @@ -4,7 +4,7 @@ This example shows that the loopback (a.k.a. what you hear) capturing with share ## Prerequisites -- Go 1.13 or later +- Go 1.17 or later ## Build diff --git a/_example/LoopbackCaptureSharedTimerDriven/go.mod b/_example/LoopbackCaptureSharedTimerDriven/go.mod old mode 100644 new mode 100755 index 3994745..79e88c5 --- a/_example/LoopbackCaptureSharedTimerDriven/go.mod +++ b/_example/LoopbackCaptureSharedTimerDriven/go.mod @@ -1,9 +1,9 @@ module LoopbackCaptureSharedTimerDriven -go 1.13 +go 1.17 require ( - github.com/go-ole/go-ole v1.2.6 + github.com/go-ole/go-ole v1.3.0 github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba github.com/moutend/go-wca v0.3.0 ) diff --git a/_example/LoopbackCaptureSharedTimerDriven/go.sum b/_example/LoopbackCaptureSharedTimerDriven/go.sum old mode 100644 new mode 100755 index 6f455d2..34edec5 --- a/_example/LoopbackCaptureSharedTimerDriven/go.sum +++ b/_example/LoopbackCaptureSharedTimerDriven/go.sum @@ -1,8 +1,12 @@ github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba h1:OjLj0dIkgDrGzgLHh2dv2BGtpa8RwCqykn2ThFcOMLc= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba/go.mod h1:y/Ls9PBADL6vJfbt4gZbNtUS2grnEGnFg4RMsCa5g/4= github.com/moutend/go-wca v0.3.0 h1:IzhsQ44zBzMdT42xlBjiLSVya9cPYOoKx9E+yXVhFo8= github.com/moutend/go-wca v0.3.0/go.mod h1:7VrPO512jnjFGJ6rr+zOoCfiYjOHRPNfbttJuxAurcw= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 h1:7TYNF4UdlohbFwpNH04CoPMp1cHUZgO1Ebq5r2hIjfo= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/_example/LoopbackCaptureSharedTimerDriven/main.go b/_example/LoopbackCaptureSharedTimerDriven/main.go old mode 100644 new mode 100755 diff --git a/_example/RenderExclusiveEventDriven/.envrc b/_example/RenderExclusiveEventDriven/.envrc old mode 100644 new mode 100755 diff --git a/_example/RenderExclusiveEventDriven/.gitignore b/_example/RenderExclusiveEventDriven/.gitignore old mode 100644 new mode 100755 diff --git a/_example/RenderExclusiveEventDriven/LICENSE b/_example/RenderExclusiveEventDriven/LICENSE old mode 100644 new mode 100755 diff --git a/_example/RenderExclusiveEventDriven/README.md b/_example/RenderExclusiveEventDriven/README.md old mode 100644 new mode 100755 index 729c3e6..5be52e8 --- a/_example/RenderExclusiveEventDriven/README.md +++ b/_example/RenderExclusiveEventDriven/README.md @@ -4,7 +4,7 @@ This example shows that the rendering audio with exclusive event driven mode. ## Prerequisites -- Go 1.13 or later +- Go 1.17 or later ## Build diff --git a/_example/RenderExclusiveEventDriven/go.mod b/_example/RenderExclusiveEventDriven/go.mod old mode 100644 new mode 100755 index 4f8e470..c0bc2e4 --- a/_example/RenderExclusiveEventDriven/go.mod +++ b/_example/RenderExclusiveEventDriven/go.mod @@ -1,9 +1,9 @@ module RenderExclusiveEventDriven -go 1.13 +go 1.17 require ( - github.com/go-ole/go-ole v1.2.6 + github.com/go-ole/go-ole v1.3.0 github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba github.com/moutend/go-wca v0.3.0 ) diff --git a/_example/RenderExclusiveEventDriven/go.sum b/_example/RenderExclusiveEventDriven/go.sum old mode 100644 new mode 100755 index 6f455d2..34edec5 --- a/_example/RenderExclusiveEventDriven/go.sum +++ b/_example/RenderExclusiveEventDriven/go.sum @@ -1,8 +1,12 @@ github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba h1:OjLj0dIkgDrGzgLHh2dv2BGtpa8RwCqykn2ThFcOMLc= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba/go.mod h1:y/Ls9PBADL6vJfbt4gZbNtUS2grnEGnFg4RMsCa5g/4= github.com/moutend/go-wca v0.3.0 h1:IzhsQ44zBzMdT42xlBjiLSVya9cPYOoKx9E+yXVhFo8= github.com/moutend/go-wca v0.3.0/go.mod h1:7VrPO512jnjFGJ6rr+zOoCfiYjOHRPNfbttJuxAurcw= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 h1:7TYNF4UdlohbFwpNH04CoPMp1cHUZgO1Ebq5r2hIjfo= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/_example/RenderExclusiveEventDriven/main.go b/_example/RenderExclusiveEventDriven/main.go old mode 100644 new mode 100755 diff --git a/_example/RenderExclusiveTimerDriven/.envrc b/_example/RenderExclusiveTimerDriven/.envrc old mode 100644 new mode 100755 diff --git a/_example/RenderExclusiveTimerDriven/.gitignore b/_example/RenderExclusiveTimerDriven/.gitignore old mode 100644 new mode 100755 diff --git a/_example/RenderExclusiveTimerDriven/LICENSE b/_example/RenderExclusiveTimerDriven/LICENSE old mode 100644 new mode 100755 diff --git a/_example/RenderExclusiveTimerDriven/README.md b/_example/RenderExclusiveTimerDriven/README.md old mode 100644 new mode 100755 index 3babd9e..7269709 --- a/_example/RenderExclusiveTimerDriven/README.md +++ b/_example/RenderExclusiveTimerDriven/README.md @@ -4,7 +4,7 @@ This example shows that the rendering audio with exclusive timer driven mode. ## Prerequisites -- Go 1.13 or later +- Go 1.17 or later ## Build diff --git a/_example/RenderExclusiveTimerDriven/go.mod b/_example/RenderExclusiveTimerDriven/go.mod old mode 100644 new mode 100755 index d49a302..6e22efc --- a/_example/RenderExclusiveTimerDriven/go.mod +++ b/_example/RenderExclusiveTimerDriven/go.mod @@ -1,9 +1,9 @@ module RenderExclusiveTimerDriven -go 1.13 +go 1.17 require ( - github.com/go-ole/go-ole v1.2.6 + github.com/go-ole/go-ole v1.3.0 github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba github.com/moutend/go-wca v0.3.0 ) diff --git a/_example/RenderExclusiveTimerDriven/go.sum b/_example/RenderExclusiveTimerDriven/go.sum old mode 100644 new mode 100755 index 6f455d2..34edec5 --- a/_example/RenderExclusiveTimerDriven/go.sum +++ b/_example/RenderExclusiveTimerDriven/go.sum @@ -1,8 +1,12 @@ github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba h1:OjLj0dIkgDrGzgLHh2dv2BGtpa8RwCqykn2ThFcOMLc= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba/go.mod h1:y/Ls9PBADL6vJfbt4gZbNtUS2grnEGnFg4RMsCa5g/4= github.com/moutend/go-wca v0.3.0 h1:IzhsQ44zBzMdT42xlBjiLSVya9cPYOoKx9E+yXVhFo8= github.com/moutend/go-wca v0.3.0/go.mod h1:7VrPO512jnjFGJ6rr+zOoCfiYjOHRPNfbttJuxAurcw= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 h1:7TYNF4UdlohbFwpNH04CoPMp1cHUZgO1Ebq5r2hIjfo= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/_example/RenderExclusiveTimerDriven/main.go b/_example/RenderExclusiveTimerDriven/main.go old mode 100644 new mode 100755 diff --git a/_example/RenderSharedEventDriven/.envrc b/_example/RenderSharedEventDriven/.envrc old mode 100644 new mode 100755 diff --git a/_example/RenderSharedEventDriven/.gitignore b/_example/RenderSharedEventDriven/.gitignore old mode 100644 new mode 100755 diff --git a/_example/RenderSharedEventDriven/LICENSE b/_example/RenderSharedEventDriven/LICENSE old mode 100644 new mode 100755 diff --git a/_example/RenderSharedEventDriven/README.md b/_example/RenderSharedEventDriven/README.md old mode 100644 new mode 100755 index 6f532f6..7cbb347 --- a/_example/RenderSharedEventDriven/README.md +++ b/_example/RenderSharedEventDriven/README.md @@ -4,7 +4,7 @@ This example shows that the rendering audio with shared event driven mode. ## Prerequisites -- Go 1.13 or later +- Go 1.17 or later ## Build diff --git a/_example/RenderSharedEventDriven/go.mod b/_example/RenderSharedEventDriven/go.mod old mode 100644 new mode 100755 index 1329404..2b0dbbe --- a/_example/RenderSharedEventDriven/go.mod +++ b/_example/RenderSharedEventDriven/go.mod @@ -1,9 +1,9 @@ module RenderSharedEventDriven -go 1.13 +go 1.17 require ( - github.com/go-ole/go-ole v1.2.6 + github.com/go-ole/go-ole v1.3.0 github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba github.com/moutend/go-wca v0.3.0 ) diff --git a/_example/RenderSharedEventDriven/go.sum b/_example/RenderSharedEventDriven/go.sum old mode 100644 new mode 100755 index 6f455d2..34edec5 --- a/_example/RenderSharedEventDriven/go.sum +++ b/_example/RenderSharedEventDriven/go.sum @@ -1,8 +1,12 @@ github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba h1:OjLj0dIkgDrGzgLHh2dv2BGtpa8RwCqykn2ThFcOMLc= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba/go.mod h1:y/Ls9PBADL6vJfbt4gZbNtUS2grnEGnFg4RMsCa5g/4= github.com/moutend/go-wca v0.3.0 h1:IzhsQ44zBzMdT42xlBjiLSVya9cPYOoKx9E+yXVhFo8= github.com/moutend/go-wca v0.3.0/go.mod h1:7VrPO512jnjFGJ6rr+zOoCfiYjOHRPNfbttJuxAurcw= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 h1:7TYNF4UdlohbFwpNH04CoPMp1cHUZgO1Ebq5r2hIjfo= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/_example/RenderSharedEventDriven/main.go b/_example/RenderSharedEventDriven/main.go old mode 100644 new mode 100755 diff --git a/_example/RenderSharedTimerDriven/.envrc b/_example/RenderSharedTimerDriven/.envrc old mode 100644 new mode 100755 diff --git a/_example/RenderSharedTimerDriven/.gitignore b/_example/RenderSharedTimerDriven/.gitignore old mode 100644 new mode 100755 diff --git a/_example/RenderSharedTimerDriven/LICENSE b/_example/RenderSharedTimerDriven/LICENSE old mode 100644 new mode 100755 diff --git a/_example/RenderSharedTimerDriven/README.md b/_example/RenderSharedTimerDriven/README.md old mode 100644 new mode 100755 index a1db695..29c46de --- a/_example/RenderSharedTimerDriven/README.md +++ b/_example/RenderSharedTimerDriven/README.md @@ -4,7 +4,7 @@ This example shows that the rendering audio with shared timer driven mode. ## Prerequisites -- Go 1.13 or later +- Go 1.17 or later ## Build diff --git a/_example/RenderSharedTimerDriven/go.mod b/_example/RenderSharedTimerDriven/go.mod old mode 100644 new mode 100755 index 5f7c368..c540939 --- a/_example/RenderSharedTimerDriven/go.mod +++ b/_example/RenderSharedTimerDriven/go.mod @@ -1,9 +1,9 @@ module RenderSharedTimerDriven -go 1.13 +go 1.17 require ( - github.com/go-ole/go-ole v1.2.6 + github.com/go-ole/go-ole v1.3.0 github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba github.com/moutend/go-wca v0.3.0 ) diff --git a/_example/RenderSharedTimerDriven/go.sum b/_example/RenderSharedTimerDriven/go.sum old mode 100644 new mode 100755 index 6f455d2..34edec5 --- a/_example/RenderSharedTimerDriven/go.sum +++ b/_example/RenderSharedTimerDriven/go.sum @@ -1,8 +1,12 @@ github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba h1:OjLj0dIkgDrGzgLHh2dv2BGtpa8RwCqykn2ThFcOMLc= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba/go.mod h1:y/Ls9PBADL6vJfbt4gZbNtUS2grnEGnFg4RMsCa5g/4= github.com/moutend/go-wca v0.3.0 h1:IzhsQ44zBzMdT42xlBjiLSVya9cPYOoKx9E+yXVhFo8= github.com/moutend/go-wca v0.3.0/go.mod h1:7VrPO512jnjFGJ6rr+zOoCfiYjOHRPNfbttJuxAurcw= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 h1:7TYNF4UdlohbFwpNH04CoPMp1cHUZgO1Ebq5r2hIjfo= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/_example/RenderSharedTimerDriven/main.go b/_example/RenderSharedTimerDriven/main.go old mode 100644 new mode 100755 diff --git a/_example/RenderSharedTimerDrivenWithMinimumBuffer/.envrc b/_example/RenderSharedTimerDrivenWithMinimumBuffer/.envrc old mode 100644 new mode 100755 diff --git a/_example/RenderSharedTimerDrivenWithMinimumBuffer/.gitignore b/_example/RenderSharedTimerDrivenWithMinimumBuffer/.gitignore old mode 100644 new mode 100755 diff --git a/_example/RenderSharedTimerDrivenWithMinimumBuffer/LICENSE b/_example/RenderSharedTimerDrivenWithMinimumBuffer/LICENSE old mode 100644 new mode 100755 diff --git a/_example/RenderSharedTimerDrivenWithMinimumBuffer/README.md b/_example/RenderSharedTimerDrivenWithMinimumBuffer/README.md old mode 100644 new mode 100755 index b8ad3e1..c93ec0c --- a/_example/RenderSharedTimerDrivenWithMinimumBuffer/README.md +++ b/_example/RenderSharedTimerDrivenWithMinimumBuffer/README.md @@ -6,7 +6,7 @@ FYI, `IAudioClient3` interface was introduced from Windows 10, which interface a ## Prerequisites -- Go 1.13 or later +- Go 1.17 or later - Windows 10 v1607 or later ## Build diff --git a/_example/RenderSharedTimerDrivenWithMinimumBuffer/go.mod b/_example/RenderSharedTimerDrivenWithMinimumBuffer/go.mod old mode 100644 new mode 100755 index b87eddd..3a7f6b4 --- a/_example/RenderSharedTimerDrivenWithMinimumBuffer/go.mod +++ b/_example/RenderSharedTimerDrivenWithMinimumBuffer/go.mod @@ -1,9 +1,9 @@ module RenderSharedTimerDrivenWithMinimumBuffer -go 1.13 +go 1.17 require ( - github.com/go-ole/go-ole v1.2.6 + github.com/go-ole/go-ole v1.3.0 github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba github.com/moutend/go-wca v0.3.0 ) diff --git a/_example/RenderSharedTimerDrivenWithMinimumBuffer/go.sum b/_example/RenderSharedTimerDrivenWithMinimumBuffer/go.sum old mode 100644 new mode 100755 index 6f455d2..34edec5 --- a/_example/RenderSharedTimerDrivenWithMinimumBuffer/go.sum +++ b/_example/RenderSharedTimerDrivenWithMinimumBuffer/go.sum @@ -1,8 +1,12 @@ github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba h1:OjLj0dIkgDrGzgLHh2dv2BGtpa8RwCqykn2ThFcOMLc= github.com/moutend/go-wav v0.0.0-20170820031854-56127fbbb7ba/go.mod h1:y/Ls9PBADL6vJfbt4gZbNtUS2grnEGnFg4RMsCa5g/4= github.com/moutend/go-wca v0.3.0 h1:IzhsQ44zBzMdT42xlBjiLSVya9cPYOoKx9E+yXVhFo8= github.com/moutend/go-wca v0.3.0/go.mod h1:7VrPO512jnjFGJ6rr+zOoCfiYjOHRPNfbttJuxAurcw= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 h1:7TYNF4UdlohbFwpNH04CoPMp1cHUZgO1Ebq5r2hIjfo= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/_example/RenderSharedTimerDrivenWithMinimumBuffer/main.go b/_example/RenderSharedTimerDrivenWithMinimumBuffer/main.go old mode 100644 new mode 100755 diff --git a/go.mod b/go.mod old mode 100644 new mode 100755 index 196c540..949f22f --- a/go.mod +++ b/go.mod @@ -1,5 +1,5 @@ -module github.com/moutend/go-wca +module github.com/cruffinoni/go-wca -go 1.13 +go 1.17 -require github.com/go-ole/go-ole v1.2.6 +require github.com/go-ole/go-ole v1.3.0 diff --git a/go.sum b/go.sum old mode 100644 new mode 100755 index 6b138a4..bd85d04 --- a/go.sum +++ b/go.sum @@ -2,5 +2,9 @@ github.com/go-ole/go-ole v1.2.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI= github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 h1:7TYNF4UdlohbFwpNH04CoPMp1cHUZgO1Ebq5r2hIjfo= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/pkg/wca/AudioClientProperties.go b/pkg/wca/AudioClientProperties.go old mode 100644 new mode 100755 diff --git a/pkg/wca/GUID.go b/pkg/wca/GUID.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioCaptureClient.go b/pkg/wca/IAudioCaptureClient.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioCaptureClient_func.go b/pkg/wca/IAudioCaptureClient_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioCaptureClient_windows.go b/pkg/wca/IAudioCaptureClient_windows.go old mode 100644 new mode 100755 index 2e15b4d..0bb3c70 --- a/pkg/wca/IAudioCaptureClient_windows.go +++ b/pkg/wca/IAudioCaptureClient_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -11,9 +10,8 @@ import ( ) func accGetBuffer(acc *IAudioCaptureClient, data **byte, framesToRead, flags *uint32, devicePosition, qpcPosition *uint64) (err error) { - hr, _, _ := syscall.Syscall6( + hr, _, _ := syscall.SyscallN( acc.VTable().GetBuffer, - 6, uintptr(unsafe.Pointer(acc)), uintptr(unsafe.Pointer(data)), uintptr(unsafe.Pointer(framesToRead)), @@ -27,12 +25,10 @@ func accGetBuffer(acc *IAudioCaptureClient, data **byte, framesToRead, flags *ui } func accReleaseBuffer(acc *IAudioCaptureClient, framesRead uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( acc.VTable().ReleaseBuffer, - 2, uintptr(unsafe.Pointer(acc)), - uintptr(framesRead), - 0) + uintptr(framesRead)) if hr != 0 { err = ole.NewError(hr) } @@ -40,12 +36,10 @@ func accReleaseBuffer(acc *IAudioCaptureClient, framesRead uint32) (err error) { } func accGetNextPacketSize(acc *IAudioCaptureClient, framesInNextPacket *uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( acc.VTable().GetNextPacketSize, - 2, uintptr(unsafe.Pointer(acc)), - uintptr(unsafe.Pointer(framesInNextPacket)), - 0) + uintptr(unsafe.Pointer(framesInNextPacket))) if hr != 0 { err = ole.NewError(hr) } diff --git a/pkg/wca/IAudioClient.go b/pkg/wca/IAudioClient.go old mode 100644 new mode 100755 index d4e2a57..797480b --- a/pkg/wca/IAudioClient.go +++ b/pkg/wca/IAudioClient.go @@ -35,6 +35,11 @@ func (v *IAudioClient) Initialize(shareMode, streamFlags uint32, nsBufferDuratio return } +func (v *IAudioClient) InitializeWithFormatEx(shareMode, streamFlags uint32, nsBufferDuration, nsPeriodicity REFERENCE_TIME, format *WAVEFORMATEXTENSIBLE, audioSessionGUID *ole.GUID) (err error) { + err = acInitializeEx(v, shareMode, streamFlags, nsBufferDuration, nsPeriodicity, format, audioSessionGUID) + return +} + func (v *IAudioClient) GetBufferSize(bufferFrameSize *uint32) (err error) { err = acGetBufferSize(v, bufferFrameSize) return @@ -59,6 +64,11 @@ func (v *IAudioClient) GetMixFormat(wfx **WAVEFORMATEX) (err error) { return } +func (v *IAudioClient) GetMixFormatEx(wfe **WAVEFORMATEXTENSIBLE) (err error) { + err = acGetMixFormatEx(v, wfe) + return +} + func (v *IAudioClient) GetDevicePeriod(nsDefaultDevicePeriod, nsMinimumDevicePeriod *REFERENCE_TIME) (err error) { err = acGetDevicePeriod(v, nsDefaultDevicePeriod, nsMinimumDevicePeriod) return diff --git a/pkg/wca/IAudioClient2.go b/pkg/wca/IAudioClient2.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioClient2_func.go b/pkg/wca/IAudioClient2_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioClient2_windows.go b/pkg/wca/IAudioClient2_windows.go old mode 100644 new mode 100755 index 2ae3b10..cba1c82 --- a/pkg/wca/IAudioClient2_windows.go +++ b/pkg/wca/IAudioClient2_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -11,9 +10,8 @@ import ( ) func ac2IsOffloadCapable(ac2 *IAudioClient2, category uint32, isOffloadCapable *bool) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ac2.VTable().IsOffloadCapable, - 3, uintptr(unsafe.Pointer(ac2)), uintptr(category), uintptr(unsafe.Pointer(isOffloadCapable))) @@ -24,12 +22,10 @@ func ac2IsOffloadCapable(ac2 *IAudioClient2, category uint32, isOffloadCapable * } func ac2SetClientProperties(ac2 *IAudioClient2, properties *AudioClientProperties) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ac2.VTable().SetClientProperties, - 2, uintptr(unsafe.Pointer(ac2)), - uintptr(unsafe.Pointer(properties)), - 0) + uintptr(unsafe.Pointer(properties))) if hr != 0 { err = ole.NewError(hr) } @@ -42,15 +38,13 @@ func ac2GetBufferSizeLimits(ac2 *IAudioClient2, wfx *WAVEFORMATEX, isEventDriven if isEventDriven { isEventDrivenValue = 1 } - hr, _, _ := syscall.Syscall6( + hr, _, _ := syscall.SyscallN( ac2.VTable().GetBufferSizeLimits, - 5, uintptr(unsafe.Pointer(ac2)), uintptr(unsafe.Pointer(wfx)), uintptr(isEventDrivenValue), uintptr(unsafe.Pointer(minBufferDuration)), - uintptr(unsafe.Pointer(maxBufferDuration)), - 0) + uintptr(unsafe.Pointer(maxBufferDuration))) if hr != 0 { err = ole.NewError(hr) } diff --git a/pkg/wca/IAudioClient3.go b/pkg/wca/IAudioClient3.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioClient3_func.go b/pkg/wca/IAudioClient3_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioClient3_windows.go b/pkg/wca/IAudioClient3_windows.go old mode 100644 new mode 100755 index 8c04ab9..a8e069a --- a/pkg/wca/IAudioClient3_windows.go +++ b/pkg/wca/IAudioClient3_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -11,9 +10,8 @@ import ( ) func ac3GetSharedModeEnginePeriod(ac3 *IAudioClient3, wfx *WAVEFORMATEX, defaultPeriodInFrames, fundamentalPeriodInFrames, minPeriodInFrames, maxPeriodInFrames *uint32) (err error) { - hr, _, _ := syscall.Syscall6( + hr, _, _ := syscall.SyscallN( ac3.VTable().GetSharedModeEnginePeriod, - 6, uintptr(unsafe.Pointer(ac3)), uintptr(unsafe.Pointer(wfx)), uintptr(unsafe.Pointer(defaultPeriodInFrames)), @@ -27,9 +25,8 @@ func ac3GetSharedModeEnginePeriod(ac3 *IAudioClient3, wfx *WAVEFORMATEX, default } func ac3GetCurrentSharedModeEnginePeriod(ac3 *IAudioClient3, wfx **WAVEFORMATEX, currentPeriodInFrames *uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ac3.VTable().GetCurrentSharedModeEnginePeriod, - 3, uintptr(unsafe.Pointer(ac3)), uintptr(unsafe.Pointer(wfx)), uintptr(unsafe.Pointer(currentPeriodInFrames))) @@ -40,15 +37,13 @@ func ac3GetCurrentSharedModeEnginePeriod(ac3 *IAudioClient3, wfx **WAVEFORMATEX, } func ac3InitializeSharedAudioStream(ac3 *IAudioClient3, streamFlags, periodInFrames uint32, wfx *WAVEFORMATEX, audioSessionGUID *ole.GUID) (err error) { - hr, _, _ := syscall.Syscall6( + hr, _, _ := syscall.SyscallN( ac3.VTable().InitializeSharedAudioStream, - 5, uintptr(unsafe.Pointer(ac3)), uintptr(streamFlags), uintptr(periodInFrames), uintptr(unsafe.Pointer(wfx)), - uintptr(unsafe.Pointer(audioSessionGUID)), - 0) + uintptr(unsafe.Pointer(audioSessionGUID))) if hr != 0 { err = ole.NewError(hr) } diff --git a/pkg/wca/IAudioClient_func.go b/pkg/wca/IAudioClient_func.go old mode 100644 new mode 100755 index 562444b..2939e90 --- a/pkg/wca/IAudioClient_func.go +++ b/pkg/wca/IAudioClient_func.go @@ -1,5 +1,4 @@ //go:build !windows -// +build !windows package wca @@ -11,6 +10,10 @@ func acInitialize(ac *IAudioClient, shareMode, streamFlags uint32, nsBufferDurat return ole.NewError(ole.E_NOTIMPL) } +func acInitializeEx(ac *IAudioClient, shareMode, streamFlags uint32, nsBufferDuration, nsPeriodicity REFERENCE_TIME, format *WAVEFORMATEXTENSIBLE, audioSessionGUID *ole.GUID) (err error) { + return ole.NewError(ole.E_NOTIMPL) +} + func acGetBufferSize(ac *IAudioClient, bufferFrameSize *uint32) (err error) { return ole.NewError(ole.E_NOTIMPL) } @@ -31,6 +34,10 @@ func acGetMixFormat(ac *IAudioClient, wfx **WAVEFORMATEX) (err error) { return ole.NewError(ole.E_NOTIMPL) } +func acGetMixFormatEx(ac *IAudioClient, wfe **WAVEFORMATEXTENSIBLE) (err error) { + return ole.NewError(ole.E_NOTIMPL) +} + func acGetDevicePeriod(ac *IAudioClient, nsDefaultDevicePeriod, nsMinimumDevicePeriod *REFERENCE_TIME) (err error) { return ole.NewError(ole.E_NOTIMPL) } diff --git a/pkg/wca/IAudioClient_windows.go b/pkg/wca/IAudioClient_windows.go old mode 100644 new mode 100755 index e890843..1e82d2f --- a/pkg/wca/IAudioClient_windows.go +++ b/pkg/wca/IAudioClient_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -12,18 +11,31 @@ import ( ) func acInitialize(ac *IAudioClient, shareMode, streamFlags uint32, nsBufferDuration, nsPeriodicity REFERENCE_TIME, format *WAVEFORMATEX, audioSessionGUID *ole.GUID) (err error) { - hr, _, _ := syscall.Syscall9( + hr, _, _ := syscall.SyscallN( ac.VTable().Initialize, - 7, uintptr(unsafe.Pointer(ac)), uintptr(shareMode), uintptr(streamFlags), uintptr(nsBufferDuration), uintptr(nsPeriodicity), uintptr(unsafe.Pointer(format)), - uintptr(unsafe.Pointer(audioSessionGUID)), - 0, - 0) + uintptr(unsafe.Pointer(audioSessionGUID))) + if hr != 0 { + err = ole.NewError(hr) + } + return +} + +func acInitializeEx(ac *IAudioClient, shareMode, streamFlags uint32, nsBufferDuration, nsPeriodicity REFERENCE_TIME, format *WAVEFORMATEXTENSIBLE, audioSessionGUID *ole.GUID) (err error) { + hr, _, _ := syscall.SyscallN( + ac.VTable().Initialize, + uintptr(unsafe.Pointer(ac)), + uintptr(shareMode), + uintptr(streamFlags), + uintptr(nsBufferDuration), + uintptr(nsPeriodicity), + uintptr(unsafe.Pointer(format)), + uintptr(unsafe.Pointer(audioSessionGUID))) if hr != 0 { err = ole.NewError(hr) } @@ -31,12 +43,10 @@ func acInitialize(ac *IAudioClient, shareMode, streamFlags uint32, nsBufferDurat } func acGetBufferSize(ac *IAudioClient, bufferFrameSize *uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ac.VTable().GetBufferSize, - 2, uintptr(unsafe.Pointer(ac)), - uintptr(unsafe.Pointer(bufferFrameSize)), - 0) + uintptr(unsafe.Pointer(bufferFrameSize))) if hr != 0 { err = ole.NewError(hr) } @@ -44,12 +54,10 @@ func acGetBufferSize(ac *IAudioClient, bufferFrameSize *uint32) (err error) { } func acGetStreamLatency(ac *IAudioClient, nsLatency *REFERENCE_TIME) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ac.VTable().GetStreamLatency, - 2, uintptr(unsafe.Pointer(ac)), - uintptr(unsafe.Pointer(nsLatency)), - 0) + uintptr(unsafe.Pointer(nsLatency))) if hr != 0 { err = ole.NewError(hr) } @@ -57,12 +65,10 @@ func acGetStreamLatency(ac *IAudioClient, nsLatency *REFERENCE_TIME) (err error) } func acGetCurrentPadding(ac *IAudioClient, numPadding *uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ac.VTable().GetCurrentPadding, - 2, uintptr(unsafe.Pointer(ac)), - uintptr(unsafe.Pointer(numPadding)), - 0) + uintptr(unsafe.Pointer(numPadding))) if hr != 0 { err = ole.NewError(hr) } @@ -70,15 +76,12 @@ func acGetCurrentPadding(ac *IAudioClient, numPadding *uint32) (err error) { } func acIsFormatSupported(ac *IAudioClient, shareMode uint32, wfx *WAVEFORMATEX, wfxClosestMatch **WAVEFORMATEX) (err error) { - hr, _, _ := syscall.Syscall6( + hr, _, _ := syscall.SyscallN( ac.VTable().IsFormatSupported, - 4, uintptr(unsafe.Pointer(ac)), uintptr(shareMode), uintptr(unsafe.Pointer(wfx)), - uintptr(unsafe.Pointer(wfxClosestMatch)), - 0, - 0) + uintptr(unsafe.Pointer(wfxClosestMatch))) if hr != 0 { err = ole.NewError(hr) } @@ -86,12 +89,21 @@ func acIsFormatSupported(ac *IAudioClient, shareMode uint32, wfx *WAVEFORMATEX, } func acGetMixFormat(ac *IAudioClient, wfx **WAVEFORMATEX) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ac.VTable().GetMixFormat, - 2, uintptr(unsafe.Pointer(ac)), - uintptr(unsafe.Pointer(wfx)), - 0) + uintptr(unsafe.Pointer(wfx))) + if hr != 0 { + err = ole.NewError(hr) + } + return +} + +func acGetMixFormatEx(ac *IAudioClient, wfe **WAVEFORMATEXTENSIBLE) (err error) { + hr, _, _ := syscall.SyscallN( + ac.VTable().GetMixFormat, + uintptr(unsafe.Pointer(ac)), + uintptr(unsafe.Pointer(wfe))) if hr != 0 { err = ole.NewError(hr) } @@ -99,9 +111,8 @@ func acGetMixFormat(ac *IAudioClient, wfx **WAVEFORMATEX) (err error) { } func acGetDevicePeriod(ac *IAudioClient, nsDefaultDevicePeriod, nsMinimumDevicePeriod *REFERENCE_TIME) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ac.VTable().GetDevicePeriod, - 3, uintptr(unsafe.Pointer(ac)), uintptr(unsafe.Pointer(nsDefaultDevicePeriod)), uintptr(unsafe.Pointer(nsMinimumDevicePeriod))) @@ -112,12 +123,9 @@ func acGetDevicePeriod(ac *IAudioClient, nsDefaultDevicePeriod, nsMinimumDeviceP } func acStart(ac *IAudioClient) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ac.VTable().Start, - 1, - uintptr(unsafe.Pointer(ac)), - 0, - 0) + uintptr(unsafe.Pointer(ac))) if hr != 0 { err = ole.NewError(hr) } @@ -125,12 +133,9 @@ func acStart(ac *IAudioClient) (err error) { } func acStop(ac *IAudioClient) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ac.VTable().Stop, - 1, - uintptr(unsafe.Pointer(ac)), - 0, - 0) + uintptr(unsafe.Pointer(ac))) if hr != 0 { err = ole.NewError(hr) } @@ -138,12 +143,9 @@ func acStop(ac *IAudioClient) (err error) { } func acReset(ac *IAudioClient) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ac.VTable().Reset, - 1, - uintptr(unsafe.Pointer(ac)), - 0, - 0) + uintptr(unsafe.Pointer(ac))) if hr != 0 { err = ole.NewError(hr) } @@ -151,12 +153,10 @@ func acReset(ac *IAudioClient) (err error) { } func acSetEventHandle(ac *IAudioClient, handle uintptr) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ac.VTable().SetEventHandle, - 2, uintptr(unsafe.Pointer(ac)), - uintptr(handle), - 0) + handle) if hr != 0 { err = ole.NewError(hr) } @@ -165,9 +165,8 @@ func acSetEventHandle(ac *IAudioClient, handle uintptr) (err error) { func acGetService(ac *IAudioClient, refIID *ole.GUID, obj interface{}) (err error) { objValue := reflect.ValueOf(obj).Elem() - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ac.VTable().GetService, - 3, uintptr(unsafe.Pointer(ac)), uintptr(unsafe.Pointer(refIID)), objValue.Addr().Pointer()) diff --git a/pkg/wca/IAudioEndpointVolume.go b/pkg/wca/IAudioEndpointVolume.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioEndpointVolume_func.go b/pkg/wca/IAudioEndpointVolume_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioEndpointVolume_windows.go b/pkg/wca/IAudioEndpointVolume_windows.go old mode 100644 new mode 100755 index 5694b4d..5fa73d5 --- a/pkg/wca/IAudioEndpointVolume_windows.go +++ b/pkg/wca/IAudioEndpointVolume_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -20,12 +19,10 @@ func aevUnregisterControlChangeNotify() (err error) { } func aevGetChannelCount(aev *IAudioEndpointVolume, channelCount *uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( aev.VTable().GetChannelCount, - 2, uintptr(unsafe.Pointer(aev)), - uintptr(unsafe.Pointer(channelCount)), - 0) + uintptr(unsafe.Pointer(channelCount))) if hr != 0 { err = ole.NewError(hr) } @@ -35,9 +32,8 @@ func aevGetChannelCount(aev *IAudioEndpointVolume, channelCount *uint32) (err er func aevSetMasterVolumeLevel(aev *IAudioEndpointVolume, levelDB float32, eventContextGUID *ole.GUID) (err error) { levelDBValue := math.Float32bits(levelDB) - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( aev.VTable().SetMasterVolumeLevel, - 3, uintptr(unsafe.Pointer(aev)), uintptr(levelDBValue), uintptr(unsafe.Pointer(eventContextGUID))) @@ -50,9 +46,8 @@ func aevSetMasterVolumeLevel(aev *IAudioEndpointVolume, levelDB float32, eventCo func aevSetMasterVolumeLevelScalar(aev *IAudioEndpointVolume, level float32, eventContextGUID *ole.GUID) (err error) { levelValue := math.Float32bits(level) - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( aev.VTable().SetMasterVolumeLevelScalar, - 3, uintptr(unsafe.Pointer(aev)), uintptr(levelValue), uintptr(unsafe.Pointer(eventContextGUID))) @@ -63,12 +58,10 @@ func aevSetMasterVolumeLevelScalar(aev *IAudioEndpointVolume, level float32, eve } func aevGetMasterVolumeLevel(aev *IAudioEndpointVolume, level *float32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( aev.VTable().GetMasterVolumeLevel, - 2, uintptr(unsafe.Pointer(aev)), - uintptr(unsafe.Pointer(level)), - 0) + uintptr(unsafe.Pointer(level))) if hr != 0 { err = ole.NewError(hr) } @@ -76,12 +69,10 @@ func aevGetMasterVolumeLevel(aev *IAudioEndpointVolume, level *float32) (err err } func aevGetMasterVolumeLevelScalar(aev *IAudioEndpointVolume, level *float32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( aev.VTable().GetMasterVolumeLevelScalar, - 2, uintptr(unsafe.Pointer(aev)), - uintptr(unsafe.Pointer(level)), - 0) + uintptr(unsafe.Pointer(level))) if hr != 0 { err = ole.NewError(hr) } @@ -91,15 +82,12 @@ func aevGetMasterVolumeLevelScalar(aev *IAudioEndpointVolume, level *float32) (e func aevSetChannelVolumeLevel(aev *IAudioEndpointVolume, channel uint32, levelDB float32, eventContextGUID *ole.GUID) (err error) { levelDBValue := math.Float32bits(levelDB) - hr, _, _ := syscall.Syscall6( + hr, _, _ := syscall.SyscallN( aev.VTable().SetChannelVolumeLevel, - 4, uintptr(unsafe.Pointer(aev)), uintptr(channel), uintptr(levelDBValue), - uintptr(unsafe.Pointer(eventContextGUID)), - 0, - 0) + uintptr(unsafe.Pointer(eventContextGUID))) if hr != 0 { err = ole.NewError(hr) } @@ -109,15 +97,12 @@ func aevSetChannelVolumeLevel(aev *IAudioEndpointVolume, channel uint32, levelDB func aevSetChannelVolumeLevelScalar(aev *IAudioEndpointVolume, channel uint32, level float32, eventContextGUID *ole.GUID) (err error) { levelValue := math.Float32bits(level) - hr, _, _ := syscall.Syscall6( + hr, _, _ := syscall.SyscallN( aev.VTable().SetChannelVolumeLevelScalar, - 4, uintptr(unsafe.Pointer(aev)), uintptr(channel), uintptr(levelValue), - uintptr(unsafe.Pointer(eventContextGUID)), - 0, - 0) + uintptr(unsafe.Pointer(eventContextGUID))) if hr != 0 { err = ole.NewError(hr) } @@ -125,9 +110,8 @@ func aevSetChannelVolumeLevelScalar(aev *IAudioEndpointVolume, channel uint32, l } func aevGetChannelVolumeLevel(aev *IAudioEndpointVolume, channel uint32, levelDB *float32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( aev.VTable().GetChannelVolumeLevel, - 3, uintptr(unsafe.Pointer(aev)), uintptr(channel), uintptr(unsafe.Pointer(levelDB))) @@ -138,9 +122,8 @@ func aevGetChannelVolumeLevel(aev *IAudioEndpointVolume, channel uint32, levelDB } func aevGetChannelVolumeLevelScalar(aev *IAudioEndpointVolume, channel uint32, level *float32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( aev.VTable().GetChannelVolumeLevelScalar, - 3, uintptr(unsafe.Pointer(aev)), uintptr(channel), uintptr(unsafe.Pointer(level))) @@ -156,9 +139,8 @@ func aevSetMute(aev *IAudioEndpointVolume, mute bool, eventContextGUID *ole.GUID if mute { muteValue = 1 } - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( aev.VTable().SetMute, - 3, uintptr(unsafe.Pointer(aev)), uintptr(muteValue), uintptr(unsafe.Pointer(eventContextGUID))) @@ -169,12 +151,10 @@ func aevSetMute(aev *IAudioEndpointVolume, mute bool, eventContextGUID *ole.GUID } func aevGetMute(aev *IAudioEndpointVolume, mute *bool) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( aev.VTable().GetMute, - 2, uintptr(unsafe.Pointer(aev)), - uintptr(unsafe.Pointer(mute)), - 0) + uintptr(unsafe.Pointer(mute))) if hr != 0 { err = ole.NewError(hr) } @@ -182,9 +162,8 @@ func aevGetMute(aev *IAudioEndpointVolume, mute *bool) (err error) { } func aevGetVolumeStepInfo(aev *IAudioEndpointVolume, step, stepCount *uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( aev.VTable().GetVolumeStepInfo, - 3, uintptr(unsafe.Pointer(aev)), uintptr(unsafe.Pointer(step)), uintptr(unsafe.Pointer(stepCount))) @@ -195,12 +174,10 @@ func aevGetVolumeStepInfo(aev *IAudioEndpointVolume, step, stepCount *uint32) (e } func aevVolumeStepUp(aev *IAudioEndpointVolume, eventContextGUID *ole.GUID) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( aev.VTable().VolumeStepUp, - 2, uintptr(unsafe.Pointer(aev)), - uintptr(unsafe.Pointer(eventContextGUID)), - 0) + uintptr(unsafe.Pointer(eventContextGUID))) if hr != 0 { err = ole.NewError(hr) } @@ -208,12 +185,10 @@ func aevVolumeStepUp(aev *IAudioEndpointVolume, eventContextGUID *ole.GUID) (err } func aevVolumeStepDown(aev *IAudioEndpointVolume, eventContextGUID *ole.GUID) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( aev.VTable().VolumeStepDown, - 2, uintptr(unsafe.Pointer(aev)), - uintptr(unsafe.Pointer(eventContextGUID)), - 0) + uintptr(unsafe.Pointer(eventContextGUID))) if hr != 0 { err = ole.NewError(hr) } @@ -221,12 +196,10 @@ func aevVolumeStepDown(aev *IAudioEndpointVolume, eventContextGUID *ole.GUID) (e } func aevQueryHardwareSupport(aev *IAudioEndpointVolume, hardwareSupportMask *uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( aev.VTable().QueryHardwareSupport, - 2, uintptr(unsafe.Pointer(aev)), - uintptr(unsafe.Pointer(hardwareSupportMask)), - 0) + uintptr(unsafe.Pointer(hardwareSupportMask))) if hr != 0 { err = ole.NewError(hr) } @@ -234,15 +207,12 @@ func aevQueryHardwareSupport(aev *IAudioEndpointVolume, hardwareSupportMask *uin } func aevGetVolumeRange(aev *IAudioEndpointVolume, minDB, maxDB, incrementDB *float32) (err error) { - hr, _, _ := syscall.Syscall6( + hr, _, _ := syscall.SyscallN( aev.VTable().GetVolumeRange, - 4, uintptr(unsafe.Pointer(aev)), uintptr(unsafe.Pointer(minDB)), uintptr(unsafe.Pointer(maxDB)), - uintptr(unsafe.Pointer(incrementDB)), - 0, - 0) + uintptr(unsafe.Pointer(incrementDB))) if hr != 0 { err = ole.NewError(hr) } diff --git a/pkg/wca/IAudioMeterInformation.go b/pkg/wca/IAudioMeterInformation.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioMeterInformation_func.go b/pkg/wca/IAudioMeterInformation_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioMeterInformation_windows.go b/pkg/wca/IAudioMeterInformation_windows.go old mode 100644 new mode 100755 index 510215f..d6df64e --- a/pkg/wca/IAudioMeterInformation_windows.go +++ b/pkg/wca/IAudioMeterInformation_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -11,12 +10,10 @@ import ( ) func amiGetPeakValue(ami *IAudioMeterInformation, peak *float32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ami.VTable().GetPeakValue, - 2, uintptr(unsafe.Pointer(ami)), - uintptr(unsafe.Pointer(peak)), - 0) + uintptr(unsafe.Pointer(peak))) if hr != 0 { err = ole.NewError(hr) } @@ -25,8 +22,7 @@ func amiGetPeakValue(ami *IAudioMeterInformation, peak *float32) (err error) { } func amiGetChannelsPeakValues(ami *IAudioMeterInformation, count uint32, peaks []float32) (err error) { - hr, _, _ := syscall.Syscall(ami.VTable().GetChannelsPeakValues, - 3, + hr, _, _ := syscall.SyscallN(ami.VTable().GetChannelsPeakValues, uintptr(unsafe.Pointer(ami)), uintptr(count), uintptr(unsafe.Pointer(&peaks[0]))) @@ -37,12 +33,10 @@ func amiGetChannelsPeakValues(ami *IAudioMeterInformation, count uint32, peaks [ } func amiGetMeteringChannelCount(ami *IAudioMeterInformation, count *uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ami.VTable().GetMeteringChannelCount, - 2, uintptr(unsafe.Pointer(ami)), - uintptr(unsafe.Pointer(count)), - 0) + uintptr(unsafe.Pointer(count))) if hr != 0 { err = ole.NewError(hr) } @@ -50,12 +44,10 @@ func amiGetMeteringChannelCount(ami *IAudioMeterInformation, count *uint32) (err } func amiQueryHardwareSupport(ami *IAudioMeterInformation, response *uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ami.VTable().GetMeteringChannelCount, - 2, uintptr(unsafe.Pointer(ami)), - uintptr(unsafe.Pointer(response)), - 0) + uintptr(unsafe.Pointer(response))) if hr != 0 { err = ole.NewError(hr) } diff --git a/pkg/wca/IAudioRenderClient.go b/pkg/wca/IAudioRenderClient.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioRenderClient_func.go b/pkg/wca/IAudioRenderClient_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioRenderClient_windows.go b/pkg/wca/IAudioRenderClient_windows.go old mode 100644 new mode 100755 index c4373f9..d852adf --- a/pkg/wca/IAudioRenderClient_windows.go +++ b/pkg/wca/IAudioRenderClient_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -11,9 +10,8 @@ import ( ) func arcGetBuffer(arc *IAudioRenderClient, requiredBufferSize uint32, data **byte) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( arc.VTable().GetBuffer, - 3, uintptr(unsafe.Pointer(arc)), uintptr(requiredBufferSize), uintptr(unsafe.Pointer(data))) @@ -24,9 +22,8 @@ func arcGetBuffer(arc *IAudioRenderClient, requiredBufferSize uint32, data **byt } func arcReleaseBuffer(arc *IAudioRenderClient, writtenBufferSize, flag uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( arc.VTable().ReleaseBuffer, - 3, uintptr(unsafe.Pointer(arc)), uintptr(writtenBufferSize), uintptr(flag)) diff --git a/pkg/wca/IAudioSessionControl.go b/pkg/wca/IAudioSessionControl.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioSessionControl2.go b/pkg/wca/IAudioSessionControl2.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioSessionControl2_func.go b/pkg/wca/IAudioSessionControl2_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioSessionControl2_windows.go b/pkg/wca/IAudioSessionControl2_windows.go old mode 100644 new mode 100755 index 0e297c5..f5cae15 --- a/pkg/wca/IAudioSessionControl2_windows.go +++ b/pkg/wca/IAudioSessionControl2_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -12,12 +11,10 @@ import ( func asc2GetSessionIdentifier(asc2 *IAudioSessionControl2, retVal *string) (err error) { var retValPtr uint64 - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asc2.VTable().GetSessionIdentifier, - 2, uintptr(unsafe.Pointer(asc2)), - uintptr(unsafe.Pointer(&retValPtr)), - 0) + uintptr(unsafe.Pointer(&retValPtr))) if hr != 0 { err = ole.NewError(hr) } @@ -39,12 +36,10 @@ func asc2GetSessionIdentifier(asc2 *IAudioSessionControl2, retVal *string) (err func asc2GetSessionInstanceIdentifier(asc2 *IAudioSessionControl2, retVal *string) (err error) { var retValPtr uint64 - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asc2.VTable().GetSessionInstanceIdentifier, - 2, uintptr(unsafe.Pointer(asc2)), - uintptr(unsafe.Pointer(&retValPtr)), - 0) + uintptr(unsafe.Pointer(&retValPtr))) if hr != 0 { err = ole.NewError(hr) } @@ -65,12 +60,10 @@ func asc2GetSessionInstanceIdentifier(asc2 *IAudioSessionControl2, retVal *strin } func asc2GetProcessId(asc2 *IAudioSessionControl2, retVal *uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asc2.VTable().GetProcessId, - 2, uintptr(unsafe.Pointer(asc2)), - uintptr(unsafe.Pointer(retVal)), - 0) + uintptr(unsafe.Pointer(retVal))) if hr != 0 { err = ole.NewError(hr) } @@ -78,12 +71,9 @@ func asc2GetProcessId(asc2 *IAudioSessionControl2, retVal *uint32) (err error) { } func asc2IsSystemSoundsSession(asc2 *IAudioSessionControl2) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asc2.VTable().IsSystemSoundsSession, - 1, - uintptr(unsafe.Pointer(asc2)), - 0, - 0) + uintptr(unsafe.Pointer(asc2))) if hr != 0 { err = ole.NewError(hr) } @@ -96,12 +86,10 @@ func asc2SetDuckingPreference(asc2 *IAudioSessionControl2, optOut bool) (err err if optOut { optOutValue = 1 } - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asc2.VTable().SetDuckingPreference, - 2, uintptr(unsafe.Pointer(asc2)), - uintptr(optOutValue), - 0) + uintptr(optOutValue)) if hr != 0 { err = ole.NewError(hr) } diff --git a/pkg/wca/IAudioSessionControl_func.go b/pkg/wca/IAudioSessionControl_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioSessionControl_windows.go b/pkg/wca/IAudioSessionControl_windows.go old mode 100644 new mode 100755 index aaf88da..611a9a6 --- a/pkg/wca/IAudioSessionControl_windows.go +++ b/pkg/wca/IAudioSessionControl_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -11,12 +10,10 @@ import ( ) func ascGetState(asc *IAudioSessionControl, retVal *uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asc.VTable().GetState, - 2, uintptr(unsafe.Pointer(asc)), - uintptr(unsafe.Pointer(retVal)), - 0) + uintptr(unsafe.Pointer(retVal))) if hr != 0 { err = ole.NewError(hr) } @@ -25,12 +22,10 @@ func ascGetState(asc *IAudioSessionControl, retVal *uint32) (err error) { func ascGetDisplayName(asc *IAudioSessionControl, retVal *string) (err error) { var retValPtr uint64 - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asc.VTable().GetDisplayName, - 2, uintptr(unsafe.Pointer(asc)), - uintptr(unsafe.Pointer(&retValPtr)), - 0) + uintptr(unsafe.Pointer(&retValPtr))) if hr != 0 { err = ole.NewError(hr) } @@ -51,9 +46,8 @@ func ascGetDisplayName(asc *IAudioSessionControl, retVal *string) (err error) { } func ascSetDisplayName(asc *IAudioSessionControl, value *string, eventContext *ole.GUID) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asc.VTable().SetDisplayName, - 3, uintptr(unsafe.Pointer(asc)), uintptr(unsafe.Pointer(value)), uintptr(unsafe.Pointer(eventContext))) @@ -65,12 +59,10 @@ func ascSetDisplayName(asc *IAudioSessionControl, value *string, eventContext *o func ascGetIconPath(asc *IAudioSessionControl, retVal *string) (err error) { var retValPtr uint64 - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asc.VTable().GetIconPath, - 2, uintptr(unsafe.Pointer(asc)), - uintptr(unsafe.Pointer(&retValPtr)), - 0) + uintptr(unsafe.Pointer(&retValPtr))) if hr != 0 { err = ole.NewError(hr) } @@ -91,9 +83,8 @@ func ascGetIconPath(asc *IAudioSessionControl, retVal *string) (err error) { } func ascSetIconPath(asc *IAudioSessionControl, value *string, eventContext *ole.GUID) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asc.VTable().SetIconPath, - 3, uintptr(unsafe.Pointer(asc)), uintptr(unsafe.Pointer(value)), uintptr(unsafe.Pointer(eventContext))) @@ -104,12 +95,10 @@ func ascSetIconPath(asc *IAudioSessionControl, value *string, eventContext *ole. } func ascGetGroupingParam(asc *IAudioSessionControl, retVal *ole.GUID) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asc.VTable().GetGroupingParam, - 2, uintptr(unsafe.Pointer(asc)), - uintptr(unsafe.Pointer(retVal)), - 0) + uintptr(unsafe.Pointer(retVal))) if hr != 0 { err = ole.NewError(hr) } @@ -117,9 +106,8 @@ func ascGetGroupingParam(asc *IAudioSessionControl, retVal *ole.GUID) (err error } func ascSetGroupingParam(asc *IAudioSessionControl, override *ole.GUID, eventContext *ole.GUID) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asc.VTable().SetGroupingParam, - 3, uintptr(unsafe.Pointer(asc)), uintptr(unsafe.Pointer(override)), uintptr(unsafe.Pointer(eventContext))) @@ -130,12 +118,10 @@ func ascSetGroupingParam(asc *IAudioSessionControl, override *ole.GUID, eventCon } func ascRegisterAudioSessionNotification(asc *IAudioSessionControl, newNotifications *IAudioSessionEvents) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asc.VTable().RegisterAudioSessionNotification, - 2, uintptr(unsafe.Pointer(asc)), - uintptr(unsafe.Pointer(newNotifications)), - 0) + uintptr(unsafe.Pointer(newNotifications))) if hr != 0 { err = ole.NewError(hr) } @@ -143,12 +129,10 @@ func ascRegisterAudioSessionNotification(asc *IAudioSessionControl, newNotificat } func ascUnregisterAudioSessionNotification(asc *IAudioSessionControl, newNotifications *IAudioSessionEvents) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asc.VTable().UnregisterAudioSessionNotification, - 2, uintptr(unsafe.Pointer(asc)), - uintptr(unsafe.Pointer(newNotifications)), - 0) + uintptr(unsafe.Pointer(newNotifications))) if hr != 0 { err = ole.NewError(hr) } diff --git a/pkg/wca/IAudioSessionEnumerator.go b/pkg/wca/IAudioSessionEnumerator.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioSessionEnumerator_func.go b/pkg/wca/IAudioSessionEnumerator_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioSessionEnumerator_windows.go b/pkg/wca/IAudioSessionEnumerator_windows.go old mode 100644 new mode 100755 index d0ab2ea..b4b2415 --- a/pkg/wca/IAudioSessionEnumerator_windows.go +++ b/pkg/wca/IAudioSessionEnumerator_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -11,12 +10,10 @@ import ( ) func aseGetCount(ase *IAudioSessionEnumerator, sessionCount *int) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ase.VTable().GetCount, - 2, uintptr(unsafe.Pointer(ase)), - uintptr(unsafe.Pointer(sessionCount)), - 0) + uintptr(unsafe.Pointer(sessionCount))) if hr != 0 { err = ole.NewError(hr) } @@ -24,9 +21,8 @@ func aseGetCount(ase *IAudioSessionEnumerator, sessionCount *int) (err error) { } func aseGetSession(ase *IAudioSessionEnumerator, sessionCount int, session **IAudioSessionControl) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ase.VTable().GetSession, - 3, uintptr(unsafe.Pointer(ase)), uintptr(sessionCount), uintptr(unsafe.Pointer(session))) diff --git a/pkg/wca/IAudioSessionEvents.go b/pkg/wca/IAudioSessionEvents.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioSessionManager.go b/pkg/wca/IAudioSessionManager.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioSessionManager2.go b/pkg/wca/IAudioSessionManager2.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioSessionManager2_func.go b/pkg/wca/IAudioSessionManager2_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioSessionManager2_windows.go b/pkg/wca/IAudioSessionManager2_windows.go old mode 100644 new mode 100755 index 84a817c..d70eb1d --- a/pkg/wca/IAudioSessionManager2_windows.go +++ b/pkg/wca/IAudioSessionManager2_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -11,12 +10,10 @@ import ( ) func asm2GetSessionEnumerator(asm2 *IAudioSessionManager2, sessionEnum **IAudioSessionEnumerator) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asm2.VTable().GetSessionEnumerator, - 2, uintptr(unsafe.Pointer(asm2)), - uintptr(unsafe.Pointer(sessionEnum)), - 0) + uintptr(unsafe.Pointer(sessionEnum))) if hr != 0 { err = ole.NewError(hr) } @@ -24,12 +21,10 @@ func asm2GetSessionEnumerator(asm2 *IAudioSessionManager2, sessionEnum **IAudioS } func asm2RegisterSessionNotification(asm2 *IAudioSessionManager2, sessionNotification *IAudioSessionNotification) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asm2.VTable().RegisterSessionNotification, - 2, uintptr(unsafe.Pointer(asm2)), - uintptr(unsafe.Pointer(sessionNotification)), - 0) + uintptr(unsafe.Pointer(sessionNotification))) if hr != 0 { err = ole.NewError(hr) } @@ -37,12 +32,10 @@ func asm2RegisterSessionNotification(asm2 *IAudioSessionManager2, sessionNotific } func asm2UnregisterSessionNotification(asm2 *IAudioSessionManager2, sessionNotification *IAudioSessionNotification) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asm2.VTable().UnregisterSessionNotification, - 2, uintptr(unsafe.Pointer(asm2)), - uintptr(unsafe.Pointer(sessionNotification)), - 0) + uintptr(unsafe.Pointer(sessionNotification))) if hr != 0 { err = ole.NewError(hr) } @@ -50,9 +43,8 @@ func asm2UnregisterSessionNotification(asm2 *IAudioSessionManager2, sessionNotif } func asm2RegisterDuckNotification(asm2 *IAudioSessionManager2, sessionID *string, duckNotification *IAudioVolumeDuckNotification) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asm2.VTable().RegisterDuckNotification, - 3, uintptr(unsafe.Pointer(asm2)), uintptr(unsafe.Pointer(sessionID)), uintptr(unsafe.Pointer(duckNotification))) @@ -63,12 +55,10 @@ func asm2RegisterDuckNotification(asm2 *IAudioSessionManager2, sessionID *string } func asm2UnregisterDuckNotification(asm2 *IAudioSessionManager2, duckNotification *IAudioVolumeDuckNotification) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( asm2.VTable().UnregisterDuckNotification, - 2, uintptr(unsafe.Pointer(asm2)), - uintptr(unsafe.Pointer(duckNotification)), - 0) + uintptr(unsafe.Pointer(duckNotification))) if hr != 0 { err = ole.NewError(hr) } diff --git a/pkg/wca/IAudioSessionManager_func.go b/pkg/wca/IAudioSessionManager_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioSessionManager_windows.go b/pkg/wca/IAudioSessionManager_windows.go old mode 100644 new mode 100755 index e71e94c..6fd57d5 --- a/pkg/wca/IAudioSessionManager_windows.go +++ b/pkg/wca/IAudioSessionManager_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -11,15 +10,13 @@ import ( ) func asmGetAudioSessionControl(asm *IAudioSessionManager, audioSessionGUID *ole.GUID, streamFlags uint32, sessionControl **IAudioSessionControl) (err error) { - hr, _, _ := syscall.Syscall6( + hr, _, _ := syscall.SyscallN( asm.VTable().GetAudioSessionControl, 4, uintptr(unsafe.Pointer(asm)), uintptr(unsafe.Pointer(audioSessionGUID)), uintptr(streamFlags), - uintptr(unsafe.Pointer(sessionControl)), - 0, - 0) + uintptr(unsafe.Pointer(sessionControl))) if hr != 0 { err = ole.NewError(hr) } @@ -27,15 +24,13 @@ func asmGetAudioSessionControl(asm *IAudioSessionManager, audioSessionGUID *ole. } func asmGetSimpleAudioVolume(asm *IAudioSessionManager, audioSessionGUID *ole.GUID, streamFlags uint32, audioVolume **ISimpleAudioVolume) (err error) { - hr, _, _ := syscall.Syscall6( + hr, _, _ := syscall.SyscallN( asm.VTable().GetSimpleAudioVolume, 4, uintptr(unsafe.Pointer(asm)), uintptr(unsafe.Pointer(audioSessionGUID)), uintptr(streamFlags), - uintptr(unsafe.Pointer(audioVolume)), - 0, - 0) + uintptr(unsafe.Pointer(audioVolume))) if hr != 0 { err = ole.NewError(hr) } diff --git a/pkg/wca/IAudioSessionNotification.go b/pkg/wca/IAudioSessionNotification.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IAudioVolumeDuckNotification.go b/pkg/wca/IAudioVolumeDuckNotification.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IMMDevice.go b/pkg/wca/IMMDevice.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IMMDeviceCollection.go b/pkg/wca/IMMDeviceCollection.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IMMDeviceCollection_func.go b/pkg/wca/IMMDeviceCollection_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IMMDeviceCollection_windows.go b/pkg/wca/IMMDeviceCollection_windows.go old mode 100644 new mode 100755 index 884d070..aa5a8ca --- a/pkg/wca/IMMDeviceCollection_windows.go +++ b/pkg/wca/IMMDeviceCollection_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -11,12 +10,10 @@ import ( ) func mmdcGetCount(dc *IMMDeviceCollection, count *uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( dc.VTable().GetCount, - 2, uintptr(unsafe.Pointer(dc)), - uintptr(unsafe.Pointer(count)), - 0) + uintptr(unsafe.Pointer(count))) if hr != 0 { err = ole.NewError(hr) } @@ -24,9 +21,8 @@ func mmdcGetCount(dc *IMMDeviceCollection, count *uint32) (err error) { } func mmdcItem(dc *IMMDeviceCollection, id uint32, mmd **IMMDevice) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( dc.VTable().Item, - 3, uintptr(unsafe.Pointer(dc)), uintptr(id), uintptr(unsafe.Pointer(mmd))) diff --git a/pkg/wca/IMMDeviceEnumerator.go b/pkg/wca/IMMDeviceEnumerator.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IMMDeviceEnumerator_func.go b/pkg/wca/IMMDeviceEnumerator_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IMMDeviceEnumerator_windows.go b/pkg/wca/IMMDeviceEnumerator_windows.go old mode 100644 new mode 100755 index f2483ea..76665c3 --- a/pkg/wca/IMMDeviceEnumerator_windows.go +++ b/pkg/wca/IMMDeviceEnumerator_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -11,15 +10,12 @@ import ( ) func mmdeEnumAudioEndpoints(mmde *IMMDeviceEnumerator, eDataFlow, stateMask uint32, dc **IMMDeviceCollection) (err error) { - hr, _, _ := syscall.Syscall6( + hr, _, _ := syscall.SyscallN( mmde.VTable().EnumAudioEndpoints, - 4, uintptr(unsafe.Pointer(mmde)), uintptr(eDataFlow), //uintptr(unsafe.Pointer(&eDataFlow)), uintptr(stateMask), //uintptr(unsafe.Pointer(&stateMask)), - uintptr(unsafe.Pointer(dc)), - 0, - 0) + uintptr(unsafe.Pointer(dc))) if hr != 0 { err = ole.NewError(hr) } @@ -27,15 +23,12 @@ func mmdeEnumAudioEndpoints(mmde *IMMDeviceEnumerator, eDataFlow, stateMask uint } func mmdeGetDefaultAudioEndpoint(mmde *IMMDeviceEnumerator, eDataFlow, stateMask uint32, mmd **IMMDevice) (err error) { - hr, _, _ := syscall.Syscall6( + hr, _, _ := syscall.SyscallN( mmde.VTable().GetDefaultAudioEndpoint, - 4, uintptr(unsafe.Pointer(mmde)), uintptr(eDataFlow), uintptr(stateMask), - uintptr(unsafe.Pointer(mmd)), - 0, - 0) + uintptr(unsafe.Pointer(mmd))) if hr != 0 { err = ole.NewError(hr) } @@ -47,12 +40,10 @@ func mmdeGetDevice() (err error) { } func mmdeRegisterEndpointNotificationCallback(mmde *IMMDeviceEnumerator, mmnc *IMMNotificationClient) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( mmde.VTable().RegisterEndpointNotificationCallback, - 2, uintptr(unsafe.Pointer(mmde)), - uintptr(unsafe.Pointer(mmnc)), - 0) + uintptr(unsafe.Pointer(mmnc))) if hr != 0 { err = ole.NewError(hr) } diff --git a/pkg/wca/IMMDevice_func.go b/pkg/wca/IMMDevice_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IMMDevice_windows.go b/pkg/wca/IMMDevice_windows.go old mode 100644 new mode 100755 index 031478c..9077b68 --- a/pkg/wca/IMMDevice_windows.go +++ b/pkg/wca/IMMDevice_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -13,15 +12,13 @@ import ( func mmdActivate(mmd *IMMDevice, refIID *ole.GUID, ctx uint32, prop, obj interface{}) (err error) { objValue := reflect.ValueOf(obj).Elem() - hr, _, _ := syscall.Syscall6( + hr, _, _ := syscall.SyscallN( mmd.VTable().Activate, - 5, uintptr(unsafe.Pointer(mmd)), uintptr(unsafe.Pointer(refIID)), uintptr(unsafe.Pointer(&ctx)), 0, - objValue.Addr().Pointer(), - 0) + objValue.Addr().Pointer()) if hr != 0 { err = ole.NewError(hr) } @@ -29,9 +26,8 @@ func mmdActivate(mmd *IMMDevice, refIID *ole.GUID, ctx uint32, prop, obj interfa } func mmdOpenPropertyStore(mmd *IMMDevice, storageMode uint32, ps **IPropertyStore) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( mmd.VTable().OpenPropertyStore, - 3, uintptr(unsafe.Pointer(mmd)), uintptr(storageMode), uintptr(unsafe.Pointer(ps))) @@ -43,12 +39,10 @@ func mmdOpenPropertyStore(mmd *IMMDevice, storageMode uint32, ps **IPropertyStor func mmdGetId(mmd *IMMDevice, strId *string) (err error) { var strIdPtr uint64 - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( mmd.VTable().GetId, - 2, uintptr(unsafe.Pointer(mmd)), - uintptr(unsafe.Pointer(&strIdPtr)), - 0) + uintptr(unsafe.Pointer(&strIdPtr))) if hr != 0 { err = ole.NewError(hr) } @@ -71,12 +65,10 @@ func mmdGetId(mmd *IMMDevice, strId *string) (err error) { } func mmdGetState(mmd *IMMDevice, state *uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( mmd.VTable().GetState, - 2, uintptr(unsafe.Pointer(mmd)), - uintptr(unsafe.Pointer(state)), - 0) + uintptr(unsafe.Pointer(state))) if hr != 0 { err = ole.NewError(hr) } diff --git a/pkg/wca/IMMEndpoint.go b/pkg/wca/IMMEndpoint.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IMMEndpoint_func.go b/pkg/wca/IMMEndpoint_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IMMEndpoint_windows.go b/pkg/wca/IMMEndpoint_windows.go old mode 100644 new mode 100755 index 26b4569..7a544e8 --- a/pkg/wca/IMMEndpoint_windows.go +++ b/pkg/wca/IMMEndpoint_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -11,12 +10,10 @@ import ( ) func mmeGetDataFlow(mme *IMMEndpoint, eDataFlow *uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( mme.VTable().GetDataFlow, - 2, uintptr(unsafe.Pointer(mme)), - uintptr(unsafe.Pointer(eDataFlow)), - 0) + uintptr(unsafe.Pointer(eDataFlow))) if hr != 0 { err = ole.NewError(hr) } diff --git a/pkg/wca/IMMNotificationClient.go b/pkg/wca/IMMNotificationClient.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IMMNotificationClient_windows.go b/pkg/wca/IMMNotificationClient_windows.go old mode 100644 new mode 100755 index 9127785..579e2d5 --- a/pkg/wca/IMMNotificationClient_windows.go +++ b/pkg/wca/IMMNotificationClient_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca diff --git a/pkg/wca/IPropertyStore.go b/pkg/wca/IPropertyStore.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IPropertyStore_func.go b/pkg/wca/IPropertyStore_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/IPropertyStore_windows.go b/pkg/wca/IPropertyStore_windows.go old mode 100644 new mode 100755 index f8f6220..0a0cb0a --- a/pkg/wca/IPropertyStore_windows.go +++ b/pkg/wca/IPropertyStore_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -11,12 +10,10 @@ import ( ) func psGetCount(ps *IPropertyStore, count *uint32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ps.VTable().GetCount, - 2, uintptr(unsafe.Pointer(ps)), - uintptr(unsafe.Pointer(count)), - 0) + uintptr(unsafe.Pointer(count))) if hr != 0 { err = ole.NewError(hr) } @@ -24,9 +21,8 @@ func psGetCount(ps *IPropertyStore, count *uint32) (err error) { } func psGetAt(ps *IPropertyStore, iProp uint32, pkey *PROPERTYKEY) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ps.VTable().GetAt, - 3, uintptr(unsafe.Pointer(ps)), uintptr(iProp), uintptr(unsafe.Pointer(pkey))) @@ -37,9 +33,8 @@ func psGetAt(ps *IPropertyStore, iProp uint32, pkey *PROPERTYKEY) (err error) { } func psGetValue(ps *IPropertyStore, key *PROPERTYKEY, pv *PROPVARIANT) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( ps.VTable().GetValue, - 3, uintptr(unsafe.Pointer(ps)), uintptr(unsafe.Pointer(key)), uintptr(unsafe.Pointer(pv))) diff --git a/pkg/wca/ISimpleAudioVolume.go b/pkg/wca/ISimpleAudioVolume.go old mode 100644 new mode 100755 diff --git a/pkg/wca/ISimpleAudioVolume_func.go b/pkg/wca/ISimpleAudioVolume_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/ISimpleAudioVolume_windows.go b/pkg/wca/ISimpleAudioVolume_windows.go old mode 100644 new mode 100755 index 457e9f5..7cc0dea --- a/pkg/wca/ISimpleAudioVolume_windows.go +++ b/pkg/wca/ISimpleAudioVolume_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca @@ -14,9 +13,8 @@ import ( func savSetMasterVolume(sav *ISimpleAudioVolume, level float32, eventContext *ole.GUID) (err error) { levelValue := math.Float32bits(level) - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( sav.VTable().SetMasterVolume, - 3, uintptr(unsafe.Pointer(sav)), uintptr(levelValue), uintptr(unsafe.Pointer(eventContext))) @@ -27,12 +25,10 @@ func savSetMasterVolume(sav *ISimpleAudioVolume, level float32, eventContext *ol } func savGetMasterVolume(sav *ISimpleAudioVolume, level *float32) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( sav.VTable().GetMasterVolume, - 2, uintptr(unsafe.Pointer(sav)), - uintptr(unsafe.Pointer(level)), - 0) + uintptr(unsafe.Pointer(level))) if hr != 0 { err = ole.NewError(hr) } @@ -45,9 +41,8 @@ func savSetMute(sav *ISimpleAudioVolume, mute bool, eventContext *ole.GUID) (err if mute { muteValue = 1 } - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( sav.VTable().SetMute, - 3, uintptr(unsafe.Pointer(sav)), uintptr(muteValue), uintptr(unsafe.Pointer(eventContext))) @@ -58,12 +53,10 @@ func savSetMute(sav *ISimpleAudioVolume, mute bool, eventContext *ole.GUID) (err } func savGetMute(sav *ISimpleAudioVolume, mute *bool) (err error) { - hr, _, _ := syscall.Syscall( + hr, _, _ := syscall.SyscallN( sav.VTable().GetMute, - 2, uintptr(unsafe.Pointer(sav)), - uintptr(unsafe.Pointer(mute)), - 0) + uintptr(unsafe.Pointer(mute))) if hr != 0 { err = ole.NewError(hr) } diff --git a/pkg/wca/PROPERTYKEY.go b/pkg/wca/PROPERTYKEY.go old mode 100644 new mode 100755 diff --git a/pkg/wca/PROPVARIANT.go b/pkg/wca/PROPVARIANT.go old mode 100644 new mode 100755 diff --git a/pkg/wca/PROPVARIANT_func.go b/pkg/wca/PROPVARIANT_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/PROPVARIANT_windows.go b/pkg/wca/PROPVARIANT_windows.go old mode 100644 new mode 100755 index 57c6985..48f5d0b --- a/pkg/wca/PROPVARIANT_windows.go +++ b/pkg/wca/PROPVARIANT_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca diff --git a/pkg/wca/WAVEFORMATEX.go b/pkg/wca/WAVEFORMATEX.go old mode 100644 new mode 100755 index 3b7652b..161be04 --- a/pkg/wca/WAVEFORMATEX.go +++ b/pkg/wca/WAVEFORMATEX.go @@ -1,5 +1,9 @@ package wca +import "github.com/go-ole/go-ole" + +// WAVEFORMATEX structure defines the format of waveform-audio data +// https://learn.microsoft.com/en-us/windows/win32/api/mmreg/ns-mmreg-waveformatex type WAVEFORMATEX struct { WFormatTag uint16 NChannels uint16 @@ -9,3 +13,46 @@ type WAVEFORMATEX struct { WBitsPerSample uint16 CbSize uint16 } + +// WAVEFORMATEXTENSIBLE structure extends WAVEFORMATEX +// See: https://learn.microsoft.com/en-us/windows/win32/api/mmreg/ns-mmreg-waveformatextensible +type WAVEFORMATEXTENSIBLE struct { + Format WAVEFORMATEX + Samples uint16 // union { ValidBitsPerSample or SamplesPerBlock or Reserved } + DwChannelMask uint32 + SubFormat ole.GUID +} + +var ( + // KSDATAFORMAT_SUBTYPE_PCM PCM Audio Data Format + KSDATAFORMAT_SUBTYPE_PCM = &ole.GUID{ + Data1: 0x00000001, + Data2: 0x0000, + Data3: 0x0010, + Data4: [8]byte{0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}, + } + + // KSDATAFORMAT_SUBTYPE_IEEE_FLOAT IEEE Float Audio Data Format + KSDATAFORMAT_SUBTYPE_IEEE_FLOAT = &ole.GUID{ + Data1: 0x00000003, + Data2: 0x0000, + Data3: 0x0010, + Data4: [8]byte{0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}, + } + + // KSDATAFORMAT_SUBTYPE_ALAW ALAW Audio Data Format + KSDATAFORMAT_SUBTYPE_ALAW = &ole.GUID{ + Data1: 0x00000006, + Data2: 0x0000, + Data3: 0x0010, + Data4: [8]byte{0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}, + } + + // KSDATAFORMAT_SUBTYPE_MULAW MULAW Audio Data Format + KSDATAFORMAT_SUBTYPE_MULAW = &ole.GUID{ + Data1: 0x00000007, + Data2: 0x0000, + Data3: 0x0010, + Data4: [8]byte{0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}, + } +) diff --git a/pkg/wca/com_func.go b/pkg/wca/com_func.go old mode 100644 new mode 100755 diff --git a/pkg/wca/com_windows.go b/pkg/wca/com_windows.go old mode 100644 new mode 100755 index 9624276..f7a2901 --- a/pkg/wca/com_windows.go +++ b/pkg/wca/com_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package wca diff --git a/pkg/wca/constants.go b/pkg/wca/constants.go old mode 100644 new mode 100755 index e1365e2..b8e1b65 --- a/pkg/wca/constants.go +++ b/pkg/wca/constants.go @@ -12,6 +12,10 @@ const ( AUDCLNT_STREAMOPTIONS_MATCH_FORMAT ) +const ( + WAVE_FORMAT_EXTENSIBLE = 0xFFFE +) + const ( AudioCategory_Other = iota AudioCategory_ForegroundOnlyMedia @@ -168,3 +172,24 @@ const ( AudioSessionStateActive AudioSessionStateExpired ) + +const ( + SPEAKER_FRONT_LEFT = 0x1 + SPEAKER_FRONT_RIGHT = 0x2 + SPEAKER_FRONT_CENTER = 0x4 + SPEAKER_LOW_FREQUENCY = 0x8 + SPEAKER_BACK_LEFT = 0x10 + SPEAKER_BACK_RIGHT = 0x20 + SPEAKER_FRONT_LEFT_OF_CENTER = 0x40 + SPEAKER_FRONT_RIGHT_OF_CENTER = 0x80 + SPEAKER_BACK_CENTER = 0x100 + SPEAKER_SIDE_LEFT = 0x200 + SPEAKER_SIDE_RIGHT = 0x400 + SPEAKER_TOP_CENTER = 0x800 + SPEAKER_TOP_FRONT_LEFT = 0x1000 + SPEAKER_TOP_FRONT_CENTER = 0x2000 + SPEAKER_TOP_FRONT_RIGHT = 0x4000 + SPEAKER_TOP_BACK_LEFT = 0x8000 + SPEAKER_TOP_BACK_CENTER = 0x10000 + SPEAKER_TOP_BACK_RIGHT = 0x20000 +) diff --git a/pkg/wca/types.go b/pkg/wca/types.go old mode 100644 new mode 100755