示例#1
0
func (p *Player) SetVolume(volume int) error {
	if p.player == nil {
		return errors.New("A player must first be initialized")
	}

	C.libvlc_audio_set_volume(p.player, C.int(volume))
	return getError()
}
示例#2
0
文件: player.go 项目: jteeuwen/go-vlc
// SetVolume sets the current audio level.
func (this *Player) SetVolume(v int) error {
	if this.ptr == nil {
		return syscall.EINVAL
	}

	C.libvlc_audio_set_volume(this.ptr, C.int(v))
	return checkError()
}
示例#3
0
文件: player.go 项目: henrym/go-vlc
// SetVolume sets the current audio level.
func (this *Player) SetVolume(v int) error {
	if this.ptr == nil {
		return &VLCError{"Player is nil"}
	}

	C.libvlc_audio_set_volume(this.ptr, C.int(v))
	return checkError()
}