Beispiel #1
0
// SetAudioOutput sets the current audio output. Changes will be applied after
// stop and play.
func (this *Player) SetAudioOutput(output string) (err error) {
	if this.ptr == nil {
		return syscall.EINVAL
	}

	c := C.CString(output)

	if C.libvlc_audio_output_set(this.ptr, c) == 0 {
		err = checkError()
	}

	C.free(unsafe.Pointer(c))
	return
}
Beispiel #2
0
func (p *Player) SetAudioOutput(output string) error {
	if p.player == nil {
		return errors.New("A player must first be initialized")
	}

	cOutput := C.CString(output)
	defer C.free(unsafe.Pointer(cOutput))

	if C.libvlc_audio_output_set(p.player, cOutput) != 0 {
		return getError()
	}

	return nil
}