Go bindings for libsndfile

Related tags

Network gosndfile
Overview

gosndfile is a binding for libsndfile. It is distributed under the same terms (your choice of LGPL 2.1 or 3). If you install libsndfile outside of your system include and lib paths, make sure to set the environment variable PKG_CONFIG_PATH accordingly. This package should be go get-able: e.g. go get github.com/mkb218/gosndfile/sndfile

If building with libsndfile earlier than 1.0.26, you will need to define the legacy build tag: go get -tags legacy.

Issues
  • How can I open a loaded in memory  sound file?

    How can I open a loaded in memory sound file?

    Hi,

    I'm using libsndfile with OpenAL-Soft. It required me to create the buffer.

    • How can I process an audio file that I loaded into memory with ioutil.ReadFile('path')?
    opened by SeanTolstoyevski 12
  • could not determine kind of name for C.uint32_t

    could not determine kind of name for C.uint32_t

    I successfully compiled under Windows and MSYS2, but under Ubuntu I get this error: "could not determine kind of name for C.uint32_t".

    For both I used Go 1.8.

    Go env is:

    GOARCH="amd64"
    GOBIN=""
    GOEXE=""
    GOHOSTARCH="amd64"
    GOHOSTOS="linux"
    GOOS="linux"
    GOPATH="/home/ignazio/Programming/Go-Workspace"
    GORACE=""
    GOROOT="/home/ignazio/bin/go"
    GOTOOLDIR="/home/ignazio/bin/go/pkg/tool/linux_amd64"
    GCCGO="gccgo"
    CC="gcc"
    GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build419818202=/tmp/go-build -gno-record-gcc-switches"
    CXX="g++"
    CGO_ENABLED="1"
    PKG_CONFIG="pkg-config"
    CGO_CFLAGS="-g -O2"
    CGO_CPPFLAGS=""
    CGO_CXXFLAGS="-g -O2"
    CGO_FFLAGS="-g -O2"
    CGO_LDFLAGS="-g -O2"
    
    opened by neclepsio 5
  • fix the following build error on go 1.5.3

    fix the following build error on go 1.5.3

    $ go version go version go1.5.3 darwin/amd64

    $ go test -v ./command.go:401: cannot use C.uint(bi.Time_reference_low) (type C.uint) as type C.uint32_t in assignment ./command.go:402: cannot use C.uint(bi.Time_reference_high) (type C.uint) as type C.uint32_t in assignment ./command.go:409: cannot use C.uint(len(ch)) (type C.uint) as type C.uint32_t in assignment ./command.go:522: cannot use C.uint(i.Loops[index].Start) (type C.uint) as type C.uint32_t in assignment ./command.go:523: cannot use C.uint(i.Loops[index].End) (type C.uint) as type C.uint32_t in assignment ./command.go:524: cannot use C.uint(i.Loops[index].Count) (type C.uint) as type C.uint32_t in assignment FAIL _/Users/m/dev/gosndfile/sndfile [build failed]

    opened by martinlindhe 5
  • Some kind of segfault / mysterious problem.

    Some kind of segfault / mysterious problem.

    I was just trying get started with the library iterating over a file and printing the values. Got very a very odd error message. I have distilled it down to this:

    package main
    
    import (
        "fmt"
        "sndfile"
    )
    
    const bufferSize = 1024
    
    func main() {
        // The location of a test file shipped with sndfile
        inp  := "/Users/joe/personal/go/src/sndfile/test/funky.aiff"
    
        var info sndfile.Info
        soundFile, err := sndfile.Open(inp, sndfile.Read, &info)
    
        if err != nil {
            return
        }
    
        defer soundFile.Close()
    
    
        numRead := int64(-1)
    
        realBufferSize := bufferSize * info.Channels
    
        buffer := make([]float32, realBufferSize)
    
        for numRead != 0 {
            numRead, err = soundFile.ReadItems(buffer)
    
            fmt.Println("LOOP")
        }
    }
    

    When I run this:

    $ go run /tmp/breaking.go 
    LOOP
    unexpected fault address 0x3f000000
    throw: fault
    [signal 0xb code=0x1 addr=0x3f000000 pc=0x8e47]
    
    goroutine 1 [running]:
    fmt.(*fmt).padString(0xf84005a048, 0x9ea8c, 0x4, 0x9ea8c)
        /usr/local/go/src/pkg/fmt/format.go:138 +0x106
    fmt.(*fmt).fmt_s(0xf84005a048, 0x9ea8c, 0x4, 0x61288)
        /usr/local/go/src/pkg/fmt/format.go:285 +0x60
    fmt.(*pp).fmtString(0xf84005a000, 0x9ea8c, 0xf800000004, 0x76, 0x4, ...)
        /usr/local/go/src/pkg/fmt/print.go:533 +0xf1
    fmt.(*pp).printField(0xf84005a000, 0x61288, 0xf840030270, 0x76, 0x0, ...)
        /usr/local/go/src/pkg/fmt/print.go:776 +0xa9d
    fmt.(*pp).doPrint(0xf84005a000, 0x2577f70, 0x100000001, 0x101, 0x106fa0, ...)
        /usr/local/go/src/pkg/fmt/print.go:1110 +0x1f5
    fmt.Fprintln(0xf84002fbd0, 0xf84003d008, 0x2577f70, 0x100000001, 0xf84003d008, ...)
        /usr/local/go/src/pkg/fmt/print.go:279 +0x6c
    fmt.Println(0x2577f70, 0x100000001, 0x504f4f4c00000004, 0x0, 0x0, ...)
        /usr/local/go/src/pkg/fmt/print.go:289 +0x7b
    main.main()
        /tmp/breaking.go:32 +0x209
    
    goroutine 2 [syscall]:
    created by runtime.main
        /private/tmp/bindist454984655/go/src/pkg/runtime/proc.c:221
    exit status 2
    

    There is some kind of problem when fmt.Println is called in the second run of the loop. Mac OS 10.6.8, go1.0.2, libsndfile latest from macports.

    I am completely puzzled by this. I can't form a connection between using unsafe C functions and the fmt library. I've had a look at the gosndfile code and can't see anything obviously wrong. The line in question, /usr/local/go/src/pkg/fmt/format.go:138, is this:

    f.buf.WriteString(s)

    Perhaps there's a per-go-routine allocated buffer that's being overwritten? Perhaps the const text "LOOP" is being scribbled over? I can only guess.

    If you remove the fmt.Println the sample runs fine.

    opened by afandian 3
  • python scikits.audiolab Sndfile special chars in file name

    python scikits.audiolab Sndfile special chars in file name

    Hi ,

    Could you help me out on this , or guide me to some how can thanks

    I am trying to get a wav file information but Sndfile is unable to read file with special characters in path and file name(查找問題daw.wav) and i am unable to get information in any way , i tried passing file path to Sndfile with diferent encoding to but didnt work , but if i pass this 'C:\Users\Furqan\Desktop\test\DAW\1.wav' it works fine , Thanks is advance

    My Code is # -- coding: UTF-8 -- from scikits.audiolab import Sndfile from os import walk, path, stat

    track1 =  r'C:\Users\Furqan\Desktop\test\查找問題daw\查找問題d.wav'
    #track2 = r'C:\Users\Furqan\Desktop\test\DAW\1.wav'
    
    try:
        track_one_file_obj = Sndfile(track1, 'r')
    except:
        print('Simple didnt work')
        pass
    
    try:
        track_one_file_obj = Sndfile(track1.decode('cp1252'), 'r')
    except:
        print('cp1252 didnt work')
        pass
    
    try:
        track_one_file_obj = Sndfile(track1.encode('utf-8'), 'r')
        print(track_one_file_obj)
    except:
        print('encode didnt work')
        pass
    
    
    try:
        track_one_file_obj = Sndfile(track1.encode('utf8'), 'r')
        print(track_one_file_obj)
    except:
        print('encode didnt work')
        pass
    
    try:
        track_one_file_obj = Sndfile(track1.decode('utf-8'), 'r')
        print(track_one_file_obj)
    except:
        print('decode didnt work')
        pass
    
    opened by Fuqran 1
  • 'go get' fails to install, gcc says C '#import' is deprecated

    'go get' fails to install, gcc says C '#import' is deprecated

    When I try to go get this package, I get:

    raw.go:3:2: error: #import is a deprecated GCC extension [-Werror=deprecated] cc1: all warnings being treated as errors

    Same if I clone it locally and try to go build in the sndfile directory.

    If I change "#import" to "#include", go build then appears to build successfully.

    I am running gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5).

    opened by pshields 1
  • Fix legacy build

    Fix legacy build

    This relates to https://github.com/mkb218/gosndfile/issues/13

    When building with -tags legacy, cFromBroadcast() and SetInstrument() also throw "could not determine kind of name for C.uint32_t"

    opened by Moozaliny 0
  • Reasonable test completeness

    Reasonable test completeness

    All operations for which I can create data should be covered by automated tests. This excludes SetLoopInfo, GetEmbeddedFileInfo, and SetVbrQuality. SetRawStartOffset appears to not do anything, so the test is written but inactive.

    opened by mkb218 0
  • Add support for opus codec

    Add support for opus codec

    libsndfile supports the opus codec as of version 1.0.29. gosndfile can work with opus if the necessary constant is added.

    Reference: https://github.com/libsndfile/libsndfile/pull/406/files

    opened by hoffie 4
  • Support dithering commands

    Support dithering commands

    I just found these in sndfile.h. What do they do?

    SFC_SET_DITHER_ON_WRITE         = 0x10A0,
    SFC_SET_DITHER_ON_READ          = 0x10A1,
    
    SFC_GET_DITHER_INFO_COUNT       = 0x10A2,
    SFC_GET_DITHER_INFO             = 0x10A3,
    
    opened by mkb218 0
Owner
Matt Kane
Matt Kane
A rate limiter for Golang, with ETCD data bindings

Go Rate limiter This package allows us to have a distributed rate limiter, using Redis as a central counter. The limits that are set are only "soft" l

Nadir Hamid 0 Dec 9, 2021
Go-aspell - GNU Aspell spell checking library bindings for golang

Aspell library bindings for Go GNU Aspell is a spell checking tool written in C/

Vladimir Sibirov 44 Nov 29, 2021
libsox bindings for go

gosox "SoX − Sound eXchange, the Swiss Army knife of audio manipulation" Go bindings for the libsox sound library For more information and documentati

Kristoffer Grönlund 123 Apr 9, 2022
Go bindings for the PortAudio audio I/O library

portaudio This package provides an interface to the PortAudio audio I/O library. See the package documentation for details. To build this package you

Gordon Klaus 521 Aug 2, 2022
Go bindings for libportmidi

portmidi Want to output to an MIDI device or listen your MIDI device as an input? This package contains Go bindings for PortMidi. libportmidi (v. 217)

Jaana Dogan 267 Jun 28, 2022
Golang bindings for the Telegram Bot API

Golang bindings for the Telegram Bot API All methods are fairly self explanatory, and reading the godoc page should explain everything. If something i

null 3.9k Aug 11, 2022
OpenSSL bindings for Go

OpenSSL bindings for Go Please see http://godoc.org/github.com/spacemonkeygo/openssl for more info License Copyright (C) 2017. See AUTHORS. Licensed u

Space Monkey Go 436 Jun 1, 2022
Golang bindings for libxlsxwriter for writing XLSX files

goxlsxwriter provides Go bindings for the libxlsxwriter C library. Install goxlsxwriter requires the libxslxwriter library to be installe

Frank Terragna 18 Jun 27, 2022
Go bindings for ForestDB

goforestdb Go bindings for ForestDB Building Obtain and build forestdb: https://github.com/couchbaselabs/forestdb (run make install to install the lib

null 32 Apr 5, 2022
Go bindings for GLib type system.

Go bindings for GLib type system. This package is designed for building bindings to C libraries based on GLib type system (like GTK, GStreamer, and ot

Michał Derkacz 24 Aug 13, 2019
Source code editor written in Go using go-gtk bindings. It aims to handle navigation effectively among large number of files.

tabby Source code editor written in Go using go-gtk bindings. It aims to handle navigation effectively among large number of files. screenshot: depend

Mikhail Trushnikov 49 Dec 30, 2021
Duktape JavaScript engine bindings for Go

Duktape bindings for Go(Golang) Duktape is a thin, embeddable javascript engine. Most of the api is implemented. The exceptions are listed here. Usage

Oleg Lebedev 781 Jul 13, 2022
PHP bindings for the Go programming language (Golang)

PHP bindings for Go This package implements support for executing PHP scripts, exporting Go variables for use in PHP contexts, attaching Go method rec

Alex Palaistras 868 Aug 10, 2022
naive go bindings to the CPython C-API

go-python Naive go bindings towards the C-API of CPython-2. this package provides a go package named "python" under which most of the PyXYZ functions

Sebastien Binet 1.4k Aug 1, 2022
Go bindings for Lua C API - in progress

Go Bindings for the lua C API Simplest way to install: # go get github.com/aarzilli/golua/lua You can then try to run the examples: $ cd golua/_examp

Alessandro Arzilli 590 Jul 29, 2022
Go bindings for libmagic to detect MIME types

magicmime magicmime is a Go package which allows you to discover a file's mimetype by looking for magic numbers in its content. It could be used as a

Jaana Dogan 209 Jul 19, 2022
Go bindings for raylib, a simple and easy-to-use library to enjoy videogames programming.

raylib-go Golang bindings for raylib, a simple and easy-to-use library to enjoy videogames programming. Requirements Ubuntu X11 apt-get install libgl1

Milan Nikolic 841 Aug 3, 2022
Go bindings for the Cartographic Projections Library PROJ.4

The Go package proj provides a limited interface to the Cartographic Projections Library PROJ. For PROJ version 5 and beyond, see also: https://github

Peter Kleiweg 41 Dec 8, 2021
Go bindings for GLFW 3

GLFW 3.3 for Go Installation GLFW C library source is included and built automatically as part of the Go package. But you need to make sure you have d

OpenGL with Golang 1.3k Aug 8, 2022
Go bindings for GLFW 3

GLFW 3.3 for Go Installation GLFW C library source is included and built automatically as part of the Go package. But you need to make sure you have d

OpenGL with Golang 1.3k Aug 2, 2022
Go bindings for OpenGL (generated via glow)

gl This repository holds Go bindings to various OpenGL versions. They are auto-generated using Glow. Features: Go functions that mirror the C specific

OpenGL with Golang 915 Aug 8, 2022
Go bindings to OpenGL Utility Library

GLU This package offers minimal bindings for GLU functions. Usage go get github.com/go-gl-legacy/glu License Copyright 2012 The go-gl Authors. All ri

go-gl legacy 21 Aug 18, 2018
Go bindings for audio capture and playback with ALSA and libasound

Go ALSA bindings These bindings allow capture and playback of audio via ALSA using the alsa-lib library. Installation go get github.com/cocoonlife/goa

null 37 Jul 7, 2022
naive go bindings to GnuPlot

go-gnuplot Simple-minded functions to work with gnuplot. go-gnuplot runs gnuplot as a subprocess and pushes commands via the STDIN of that subprocess.

Sebastien Binet 26 Nov 8, 2021
go-gtk3 - GTK3 BINDINGS FOR GO

go-gtk3 - GTK3 BINDINGS FOR GO THIS IS: Hopefully GTK3 Bindings using gobject binding for Go. Goal is to have fairly complete gtk3 widgets with pango

nori satir 57 May 25, 2021
Experimental OpenAL bindings for Go.

Experimental OpenAL bindings for Go. ==================================== Everything is evolving quickly and nothing is totally done. If you want to

Peter H. Fröhlich 30 Jul 24, 2022
Go bindings for OpenCV / 2.x API in gocv / 1.x API in opencv

Go OpenCV binding A Golang binding for OpenCV. OpenCV 1.x C API bindings through CGO, and OpenCV 2+ C++ API (GoCV) through SWIG. Disclaimer This is a

go-opencv 1.3k Aug 6, 2022
Go bindings for GStreamer (retired: currently I don't use/develop this package)

Retired. I don't use/develop this package anymore. Go bindings for GStreamer at a very early stage of maturity. This package is based on GLib bindings

Michał Derkacz 165 Jul 24, 2022
Go bindings for libVLC and high-level media player interface

Go bindings for libVLC 2.X/3.X/4.X and high-level media player interface. The package can be useful for adding multimedia capabilities to applications

Adrian-George Bostan 310 Jul 28, 2022