func NewSoundBuffer(file string) SoundBuffer { str := C.CString(file) defer C.free(unsafe.Pointer(str)) return SoundBuffer{C.sfSoundBuffer_createFromFile(str)} }
// \brief Create a new sound buffer and load it from a file // Here is a complete list of all the supported audio formats: // ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam, // w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64. // \param filename Path of the sound file to load // \return A new sfSoundBuffer object (NULL if failed) // sfSoundBuffer* sfSoundBuffer_createFromFile(const char* filename); func SoundBufferFromFile(filename string) SoundBuffer { fn := C.CString(filename) return SoundBuffer{C.sfSoundBuffer_createFromFile(fn)} }