0

I have go-sox successfully splitting a stereo wav file into two files. But there are two issues:

  1. Even though the files have the same sampling rate the resulting files are sped up tremendously
  2. The resulting two files are still stereo and not mono

The code I am using is here:

https://gist.github.com/jsgoecke/ca8fe5b4e0901ed04ee0

Any ideas on how to get this working with the files playing at original speed and mono? Seems 'remix 1' and 'remix 2' should do just that.

I used brew to install SoX on OSX (v14.4.1_1).

jsgoecke
  • 249
  • 3
  • 11
  • It seems the API is not adjusted for Go and is hiding erroneous state from you. You're calling `sox.Quit` in your `init`. Deferred calls are done at the end of a function, since `init` is a normal function you're calling `sox.Quit` right after the initialization. This might not be the actual problem, but it's a separate problem at the very least. – Wessie Sep 25 '14 at 02:01
  • Yeah, you are right I need to change that. The problem did exist when I was doing that in func main() though as well. So a seperate insight from the main issue. – jsgoecke Sep 25 '14 at 04:49
  • After playing with your code and `go-sox` a bit. I've found the issue that is causing the speedup, you're not setting the output `SignalInfo` correctly. It currently thinks it is outputting 2 channels to the output file. This still leaves another problem where it only outputs half the duration of the original file, I've been unable to find the problem and am giving up on it. Conclusion is that the bindings are terrible, if you are able to I suggest you try to use the `sox` cmdline tool through `os/exec` rather than these questionable bindings. – Wessie Sep 25 '14 at 17:55
  • Thank you for trying. Maybe I need to dig into the bindings and send a pull request. But no time just now. – jsgoecke Sep 25 '14 at 22:10

0 Answers0