2
0
mirror of synced 2025-02-23 06:48:15 +00:00

audio: build on linux, not just darwin.

Change-Id: Ie10c29012bf6769591a1ad1c1e9ee322d780608e
Reviewed-on: https://go-review.googlesource.com/6392
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
Nigel Tao 2015-03-02 11:09:14 +11:00
parent f13db43649
commit 333098d850
5 changed files with 31 additions and 9 deletions

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build darwin
// +build darwin linux,!android
// Package al provides OpenAL Soft bindings for Go.
//
@ -11,20 +11,30 @@
package al
/*
// TODO(jbd,crawshaw): Add android, linux and windows support.
// TODO(jbd,crawshaw): Add android and windows support.
#cgo darwin CFLAGS: -DGOOS_darwin
#cgo linux CFLAGS: -DGOOS_linux
#cgo darwin LDFLAGS: -framework OpenAL
#cgo linux LDFLAGS: -lopenal
#ifdef GOOS_darwin
#include <stdlib.h>
#include <OpenAL/al.h>
#endif
#ifdef GOOS_linux
#include <AL/al.h>
#endif
*/
import "C"
import "unsafe"
/*
On Ubuntu 14.04 'Trusty', you may have to install these libraries:
sudo apt-get install libopenal-dev
*/
// Enable enables a capability.
func Enable(capability int32) {
C.alEnable(C.ALenum(capability))

View File

@ -2,9 +2,9 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package al
// +build darwin linux,!android
// +build darwin
package al
// Error returns one of these error codes.
const (

View File

@ -2,23 +2,35 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build darwin
// +build darwin linux,!android
// Package alc provides OpenAL's ALC (Audio Library Context) bindings for Go.
package alc
/*
#cgo darwin CFLAGS: -DGOOS_darwin
#cgo linux CFLAGS: -DGOOS_linux
#cgo darwin LDFLAGS: -framework OpenAL
#cgo linux LDFLAGS: -lopenal
#ifdef GOOS_darwin
#include <stdlib.h>
#include <OpenAL/alc.h>
#endif
#ifdef GOOS_linux
#include <stdlib.h>
#include <AL/alc.h>
#endif
*/
import "C"
import "unsafe"
/*
On Ubuntu 14.04 'Trusty', you may have to install these libraries:
sudo apt-get install libopenal-dev
*/
// Error returns one of these values.
const (
InvalidDevice = 0xA001

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build darwin
// +build darwin linux,!android
// Package audio provides a basic audio player.
package audio

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build darwin
// +build darwin linux,!android
package audio