Go+Windows+Audio

275 views
Skip to first unread message

Dmitry Shumkov

unread,
Nov 7, 2016, 12:16:37 PM11/7/16
to golang-nuts
Hi all.

I've tried to get access to Windows audio from Go program but failed. That I did below:
1. Downloaded and built Portaudio (it's open audio I/O library http://portaudio.com/). So I've built that with Visual Studio and got .dll file.
2. Downloaded Go wrapper for Portaudio - ( github.com/gordonklaus/portaudio
3. Made simple Go file with an example from wrapper above to test.
4. Go build.

So Go couldn't build that. As far as I understand that's tried to build the portaudio from source with cgo. I've installed MinGW (gcc for Windows) and pkg-config but last one can't find portaudio-2.0.pc file. Once I've renamed portaudio-2.0.pc.in to portaudio-2.0.pc however it shows gcc error: "gcc: error: @THREAD_CFLAGS@: No such file or directory". So I think it was stupid idea.


alberto sansegundo

unread,
Feb 4, 2023, 7:13:24 PM2/4/23
to golang-nuts
Hello, im now facing this same problem, did you managed to solve it?

Tobias Wellnitz

unread,
Feb 5, 2023, 7:26:31 PM2/5/23
to alberto sansegundo, golang-nuts
Alberto,

I'm using Docker for cross-compiling my cgo apps. One project of mine (remoteAudio) requires portaudio (and a couple of other C libraries like pkgconfig and libopus).
 
You can find the cross-compilation chain at github.com/dh1tw/remoteAudio-xcompile. For Windows, have a look at the windows-amd64 folder.

I have also written a companion blog post about cross compiling CGO projects.

Best regards, 
Tobias

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/8c77da1b-2a5c-4222-bb04-d84347c1a4e0n%40googlegroups.com.

Gustavo Vargas

unread,
Jan 22, 2024, 10:21:52 AMJan 22
to golang-nuts
Tobias,

Awesome blog post! Solved my issue in here! Thanks!

Reply all
Reply to author
Forward
0 new messages