예제 #1
0
파일: audio.go 프로젝트: num5/steven
func NewSoundBuffer(file string) SoundBuffer {
	str := C.CString(file)
	defer C.free(unsafe.Pointer(str))
	return SoundBuffer{C.sfSoundBuffer_createFromFile(str)}
}
예제 #2
0
// \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)}
}