// AudioOutput returns a list of available audio outputs. // // Note: Be sure to call AudioOutputList.Release() after you are done with the list. func (this *Instance) AudioOutput() (AudioOutputList, error) { if this.ptr == nil { return nil, syscall.EINVAL } if c := C.libvlc_audio_output_list_get(this.ptr); c != nil { var l AudioOutputList l.fromC(c) return l, nil } return nil, checkError() }
// AudioOutput returns a list of available audio outputs. // // Note: Be sure to call AudioOutputList.Release() after you are done with the list. func (this *Player) AudioOutput() (AudioOutputList, error) { if this.ptr == nil { return nil, &VLCError{"Player is nil"} } if c := C.libvlc_audio_output_list_get(this.ptr); c != nil { var l AudioOutputList l.fromC(c) return l, nil } return nil, checkError() }
func GetAudioOutputList() ([]*AudioOutput, error) { if instance == nil { return nil, errors.New("Module must be first initialized") } outputs := C.libvlc_audio_output_list_get(instance) if outputs == nil { return nil, getError() } defer C.libvlc_audio_output_list_release(outputs) audioOutputs := []*AudioOutput{} for p := outputs; p != nil; p = (*C.libvlc_audio_output_t)(p.p_next) { audioOutput := &AudioOutput{ Name: C.GoString(p.psz_name), Description: C.GoString(p.psz_description), } audioOutputs = append(audioOutputs, audioOutput) } return audioOutputs, getError() }