Documentation
¶
Index ¶
- Constants
- func AddSupportedFileType(ext string)
- func ChannelBytes2Seconds(handle uint, pos int) int
- func ChannelGetLength(handle uint, mode int) int
- func ChannelGetPosition(handle uint, mode int) int
- func ChannelIsActive(handle uint) int
- func ChannelPause(handle uint) int
- func ChannelPlay(handle uint, restart int) int
- func ChannelSeconds2Bytes(handle uint, pos int) int
- func ChannelSetAttribute(handle uint, attrib C.uint, value C.float) int
- func ChannelSetPosition(handle uint, pos int, mode int) int
- func ChannelSetSync(handle uint, syncType uint, param uint64, proc *C.SYNCPROC, ...) uint
- func ChannelStop(handle uint) int
- func ChannelUpdate(handle uint, length C.uint) int
- func ErrorGetCode() int
- func Free() int
- func GetCPU() float32
- func GetChanAttr(handle uint, attr uint) float32
- func GetChanVol(handle uint) uint
- func GetDevice(device C.ulong) int
- func GetInfo(info *C.BASS_INFO) int
- func GetVersion() int
- func GetVolume() float32
- func Init() int
- func Pause() int
- func PluginFree(handle int) bool
- func PluginGetFormats(handle int) string
- func PluginLoad(file string) int
- func SetChanAttr(handle uint, attr uint, value float32) uint
- func SetChanVol(handle uint, value uint) uint
- func SetDevice(device C.uint) int
- func SetVolume(value float32) bool
- func StreamCreate(freq uint, proc *C.STREAMPROC, user unsafe.Pointer) uint
- func StreamCreateFile(mem int, file string, offset uint64, length uint64) uint
- func StreamCreateURL(url string, offset uint, proc *C.DOWNLOADPROC, user unsafe.Pointer) uint
- func StreamFree(handle uint) uint32
- func StreamPutData(handle uint, buffer []byte, length int) uint32
- func SupportedFileType(ext string) bool
- type Speaker
- func (s *Speaker) Backward()
- func (s *Speaker) DecreaseVolume()
- func (s *Speaker) Finalize()
- func (s *Speaker) Forward()
- func (s *Speaker) IncreaseVolume()
- func (s *Speaker) Initialize()
- func (s *Speaker) IsNil() bool
- func (s *Speaker) IsPaused() bool
- func (s *Speaker) PauseResume()
- func (s *Speaker) Play()
- func (s *Speaker) PrePlay(sampleRete int, bufferSize int)
- func (s *Speaker) Shutdown()
- func (s *Speaker) Slowdown()
- func (s *Speaker) Speedup()
- func (s *Speaker) Status() (time.Duration, time.Duration, float64, float64)
- func (s *Speaker) UpdateStream(sampleRate int, streamer interface{}, done chan struct{})
- func (s *Speaker) UpdateURI(uri string, done chan struct{})
Constants ¶
const ( BASS_ACTIVE_STOPPED = C.BASS_ACTIVE_STOPPED BASS_ACTIVE_PLAYING = C.BASS_ACTIVE_PLAYING BASS_ACTIVE_PAUSED = C.BASS_ACTIVE_PAUSED BASS_ACTIVE_STALLED = C.BASS_ACTIVE_STALLED )
const ( BASS_POS_BYTE = C.BASS_POS_BYTE BASS_POS_MUSIC_ORDER = C.BASS_POS_MUSIC_ORDER BASS_POS_DECODE = C.BASS_POS_DECODE BASS_POS_OGG = C.BASS_POS_OGG )
BASS POSsud
const ( // Channel attributes BASS_ATTRIB_FREQ = 1 BASS_ATTRIB_VOL = 2 BASS_ATTRIB_PAN = 3 BASS_ATTRIB_EAXMIX = 4 BASS_ATTRIB_NOBUFFER = 5 BASS_ATTRIB_VBR = 6 BASS_ATTRIB_CPU = 7 BASS_ATTRIB_SRC = 8 BASS_ATTRIB_NET_RESUME = 9 BASS_ATTRIB_SCANINFO = 10 BASS_ATTRIB_NORAMP = 11 BASS_ATTRIB_BITRATE = 12 BASS_ATTRIB_BUFFER = 13 BASS_ATTRIB_MUSIC_AMPLIFY = 0x100 BASS_ATTRIB_MUSIC_PANSEP = 0x101 BASS_ATTRIB_MUSIC_PSCALER = 0x102 BASS_ATTRIB_MUSIC_BPM = 0x103 BASS_ATTRIB_MUSIC_SPEED = 0x104 BASS_ATTRIB_MUSIC_VOL_GLOBAL = 0x105 BASS_ATTRIB_MUSIC_ACTIVE = 0x106 BASS_ATTRIB_MUSIC_VOL_CHAN = 0x200 // + channel # BASS_ATTRIB_MUSIC_VOL_INST = 0x300 // + instrument # )
Attribs
const ( // Error codes returned by BASS_ErrorGetCode BASS_OK = 0 // all is OK BASS_ERROR_MEM = 1 // memory error BASS_ERROR_FILEOPEN = 2 // can't open the file BASS_ERROR_DRIVER = 3 // can't find a free/valid driver BASS_ERROR_BUFLOST = 4 // the sample buffer was lost BASS_ERROR_HANDLE = 5 // invalid handle BASS_ERROR_FORMAT = 6 // unsupported sample format BASS_ERROR_POSITION = 7 // invalid position BASS_ERROR_INIT = 8 // BASS_Init has not been successfully called BASS_ERROR_START = 9 // BASS_Start has not been successfully called BASS_ERROR_SSL = 10 // SSL/HTTPS support isn't available BASS_ERROR_ALREADY = 14 // already initialized/paused/whatever BASS_ERROR_NOCHAN = 18 // can't get a free channel BASS_ERROR_ILLTYPE = 19 // an illegal type was specified BASS_ERROR_ILLPARAM = 20 // an illegal parameter was specified BASS_ERROR_NO3D = 21 // no 3D support BASS_ERROR_NOEAX = 22 // no EAX support BASS_ERROR_DEVICE = 23 // illegal device number BASS_ERROR_NOPLAY = 24 // not playing BASS_ERROR_FREQ = 25 // illegal sample rate BASS_ERROR_NOTFILE = 27 // the stream is not a file stream BASS_ERROR_NOHW = 29 // no hardware voices available BASS_ERROR_EMPTY = 31 // the MOD music has no sequence data BASS_ERROR_NONET = 32 // no internet connection could be opened BASS_ERROR_CREATE = 33 // couldn't create the file BASS_ERROR_NOFX = 34 // effects are not available BASS_ERROR_NOTAVAIL = 37 // requested data/action is not available BASS_ERROR_DECODE = 38 // the channel is/isn't a "decoding channel" BASS_ERROR_DX = 39 // a sufficient DirectX version is not installed BASS_ERROR_TIMEOUT = 40 // connection timedout BASS_ERROR_FILEFORM = 41 // unsupported file format BASS_ERROR_SPEAKER = 42 // unavailable speaker BASS_ERROR_VERSION = 43 // invalid BASS version (used by add-ons) BASS_ERROR_CODEC = 44 // codec is not available/supported BASS_ERROR_ENDED = 45 // the channel/file has ended BASS_ERROR_BUSY = 46 // the device is busy BASS_ERROR_UNKNOWN = -1 // some other mystery problem )
ERRORS
const ( BASS_SYNC_POS = C.BASS_SYNC_POS BASS_SYNC_END = C.BASS_SYNC_END BASS_SYNC_META = C.BASS_SYNC_META BASS_SYNC_SLIDE = C.BASS_SYNC_SLIDE BASS_SYNC_STALL = C.BASS_SYNC_STALL BASS_SYNC_DOWNLOAD = C.BASS_SYNC_DOWNLOAD BASS_SYNC_FREE = C.BASS_SYNC_FREE BASS_SYNC_SETPOS = C.BASS_SYNC_SETPOS BASS_SYNC_MUSICPOS = C.BASS_SYNC_MUSICPOS BASS_SYNC_MUSICINST = C.BASS_SYNC_MUSICINST BASS_SYNC_MUSICFX = C.BASS_SYNC_MUSICFX BASS_SYNC_OGG_CHANGE = C.BASS_SYNC_OGG_CHANGE BASS_SYNC_DEV_FAIL = C.BASS_SYNC_DEV_FAIL BASS_SYNC_DEV_FORMAT = C.BASS_SYNC_DEV_FORMAT BASS_SYNC_THREAD = C.BASS_SYNC_THREAD BASS_SYNC_MIXTIME = C.BASS_SYNC_MIXTIME BASS_SYNC_ONETIME = C.BASS_SYNC_ONETIME )
Sync type
const (
BASS_UNICODE = C.BASS_UNICODE
)
---------------------------------------
Variables ¶
This section is empty.
Functions ¶
func AddSupportedFileType ¶
func AddSupportedFileType(ext string)
func ChannelBytes2Seconds ¶
ChannelBytes2Seconds Translates a byte position into time (seconds), based on a channel's format.
func ChannelGetLength ¶
ChannelGetLength Retrieves the playback length of a channel.
func ChannelGetPosition ¶
ChannelGetPosition Retrieves the playback position of a sample, stream, or MOD music. Can also be used with a recording channel.
func ChannelIsActive ¶
ChannelIsActive Checks if a sample, stream, or MOD music is active (playing) or stalled. Can also check if a recording is in progress.
func ChannelPause ¶
ChannelPause a sample, stream, MOD music, or recording.
func ChannelPlay ¶
ChannelPlay Starts (or resumes) playback of a sample, stream, MOD music, or recording.
func ChannelSeconds2Bytes ¶
ChannelSeconds2Bytes Translates a time (seconds) position into bytes, based on a channel's format.
func ChannelSetAttribute ¶
ChannelSetAttribute Sets the value of a channel's attribute.
func ChannelSetPosition ¶
ChannelSetPosition Sets the playback position of a sample, MOD music, or stream.
func ChannelSetSync ¶
func ChannelSetSync(handle uint, syncType uint, param uint64, proc *C.SYNCPROC, user unsafe.Pointer) uint
ChannelSetSync set sync callback for a channel
func ChannelStop ¶
ChannelStop Stops a sample, stream, MOD music, or recording.
func ChannelUpdate ¶
ChannelUpdate Updates the playback buffer of a stream or MOD music.
func ErrorGetCode ¶
func ErrorGetCode() int
ErrorGetCode Retrieves the error code for the most recent BASS function call in the current thread.
func Free ¶
func Free() int
Free Frees all resources used by the output device, including all its samples, streams and MOD musics.
func GetChanAttr ¶
func GetChanVol ¶
func PluginGetFormats ¶
func SetChanVol ¶
func StreamCreate ¶
StreamCreate Creates a user sample stream.
func StreamCreateFile ¶
StreamCreateFile Creates a sample stream from an MP3, MP2, MP1, OGG, WAV, AIFF or plugin supported file.
func StreamCreateURL ¶
StreamCreateURL ates a sample stream from an MP3, MP2, MP1, OGG, WAV, AIFF or plugin supported file on the internet, optionally receiving the downloaded data in a callback function.
func StreamFree ¶
func SupportedFileType ¶
Types ¶
type Speaker ¶
type Speaker struct {
// contains filtered or unexported fields
}
func NewSpeaker ¶
func NewSpeaker() *Speaker
func (*Speaker) DecreaseVolume ¶
func (s *Speaker) DecreaseVolume()
func (*Speaker) IncreaseVolume ¶
func (s *Speaker) IncreaseVolume()
func (*Speaker) Initialize ¶
func (s *Speaker) Initialize()
func (*Speaker) PauseResume ¶
func (s *Speaker) PauseResume()