vorbis.go 1.1 KB

12345678910111213141516171819202122232425
  1. // Copyright 2016 The G3N Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Package vorbis implements the Go bindings of a subset (only one function) of the functions of the libvorbis library
  5. // See API reference at: https://xiph.org/vorbis/doc/libvorbis/reference.html
  6. package vorbis
  7. // #cgo darwin CFLAGS: -DGO_DARWIN -I/usr/include/vorbis -I/usr/local/include/vorbis
  8. // #cgo freebsd CFLAGS: -DGO_FREEBSD -I/usr/local/include/vorbis
  9. // #cgo linux CFLAGS: -DGO_LINUX -I/usr/include/vorbis
  10. // #cgo windows CFLAGS: -DGO_WINDOWS -I${SRCDIR}/../windows/libvorbis-1.3.5/include/vorbis -I${SRCDIR}/../windows/libogg-1.3.3/include
  11. // #cgo darwin LDFLAGS: -L/usr/lib -L/usr/local/lib -lvorbis
  12. // #cgo freebsd LDFLAGS: -L/usr/local/lib -lvorbis
  13. // #cgo linux LDFLAGS: -lvorbis
  14. // #cgo windows LDFLAGS: -L${SRCDIR}/../windows/bin -llibvorbis
  15. // #include "codec.h"
  16. import "C"
  17. // VersionString returns a string giving version information for libvorbis
  18. func VersionString() string {
  19. cstr := C.vorbis_version_string()
  20. return C.GoString(cstr)
  21. }