bass

package
v0.0.0-...-53ca941 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
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
)
View Source
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

View Source
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

View Source
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

View Source
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

View Source
const (
	BASS_UNICODE = C.BASS_UNICODE
)

---------------------------------------

Variables

This section is empty.

Functions

func AddSupportedFileType

func AddSupportedFileType(ext string)

func ChannelBytes2Seconds

func ChannelBytes2Seconds(handle uint, pos int) int

ChannelBytes2Seconds Translates a byte position into time (seconds), based on a channel's format.

func ChannelGetLength

func ChannelGetLength(handle uint, mode int) int

ChannelGetLength Retrieves the playback length of a channel.

func ChannelGetPosition

func ChannelGetPosition(handle uint, mode int) int

ChannelGetPosition Retrieves the playback position of a sample, stream, or MOD music. Can also be used with a recording channel.

func ChannelIsActive

func ChannelIsActive(handle uint) int

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

func ChannelPause(handle uint) int

ChannelPause a sample, stream, MOD music, or recording.

func ChannelPlay

func ChannelPlay(handle uint, restart int) int

ChannelPlay Starts (or resumes) playback of a sample, stream, MOD music, or recording.

func ChannelSeconds2Bytes

func ChannelSeconds2Bytes(handle uint, pos int) int

ChannelSeconds2Bytes Translates a time (seconds) position into bytes, based on a channel's format.

func ChannelSetAttribute

func ChannelSetAttribute(handle uint, attrib C.uint, value C.float) int

ChannelSetAttribute Sets the value of a channel's attribute.

func ChannelSetPosition

func ChannelSetPosition(handle uint, pos int, mode int) int

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

func ChannelStop(handle uint) int

ChannelStop Stops a sample, stream, MOD music, or recording.

func ChannelUpdate

func ChannelUpdate(handle uint, length C.uint) int

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 GetCPU

func GetCPU() float32

GetCPU Retrieves the current CPU usage of BASS.

func GetChanAttr

func GetChanAttr(handle uint, attr uint) float32

func GetChanVol

func GetChanVol(handle uint) uint

func GetDevice

func GetDevice(device C.ulong) int

GetDevice Retrieves the device setting of the current thread.

func GetInfo

func GetInfo(info *C.BASS_INFO) int

GetInfo Retrieves information on the device being used.

func GetVersion

func GetVersion() int

GetVersion Retrieves the version of BASS that is loaded.

func GetVolume

func GetVolume() float32

GetVolume Retrieves the current master volumeBase level.

func Init

func Init() int

------Initialization,into,tec.. BassInit Initializes an output device.

func Pause

func Pause() int

Pause Stops the output, pausing all musics/samples/streams on it.

func PluginFree

func PluginFree(handle int) bool

PluginFree free a bass plugin

func PluginGetFormats

func PluginGetFormats(handle int) string

func PluginLoad

func PluginLoad(file string) int

PluginLoad load a bass plugin

func SetChanAttr

func SetChanAttr(handle uint, attr uint, value float32) uint

func SetChanVol

func SetChanVol(handle uint, value uint) uint

func SetDevice

func SetDevice(device C.uint) int

SetDevice Sets the device to use for subsequent calls in the current thread.

func SetVolume

func SetVolume(value float32) bool

func StreamCreate

func StreamCreate(freq uint, proc *C.STREAMPROC, user unsafe.Pointer) uint

StreamCreate Creates a user sample stream.

func StreamCreateFile

func StreamCreateFile(mem int, file string, offset uint64, length uint64) uint

StreamCreateFile Creates a sample stream from an MP3, MP2, MP1, OGG, WAV, AIFF or plugin supported file.

func StreamCreateURL

func StreamCreateURL(url string, offset uint, proc *C.DOWNLOADPROC, user unsafe.Pointer) uint

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 StreamFree(handle uint) uint32

func StreamPutData

func StreamPutData(handle uint, buffer []byte, length int) uint32

func SupportedFileType

func SupportedFileType(ext string) bool

Types

type Speaker

type Speaker struct {
	// contains filtered or unexported fields
}

func NewSpeaker

func NewSpeaker() *Speaker

func (*Speaker) Backward

func (s *Speaker) Backward()

func (*Speaker) DecreaseVolume

func (s *Speaker) DecreaseVolume()

func (*Speaker) Finalize

func (s *Speaker) Finalize()

func (*Speaker) Forward

func (s *Speaker) Forward()

func (*Speaker) IncreaseVolume

func (s *Speaker) IncreaseVolume()

func (*Speaker) Initialize

func (s *Speaker) Initialize()

func (*Speaker) IsNil

func (s *Speaker) IsNil() bool

func (*Speaker) IsPaused

func (s *Speaker) IsPaused() bool

func (*Speaker) PauseResume

func (s *Speaker) PauseResume()

func (*Speaker) Play

func (s *Speaker) Play()

func (*Speaker) PrePlay

func (s *Speaker) PrePlay(sampleRete int, bufferSize int)

func (*Speaker) Shutdown

func (s *Speaker) Shutdown()

func (*Speaker) Slowdown

func (s *Speaker) Slowdown()

func (*Speaker) Speedup

func (s *Speaker) Speedup()

func (*Speaker) Status

func (s *Speaker) Status() (time.Duration, time.Duration, float64, float64)

func (*Speaker) UpdateStream

func (s *Speaker) UpdateStream(sampleRate int, streamer interface{}, done chan struct{})

func (*Speaker) UpdateURI

func (s *Speaker) UpdateURI(uri string, done chan struct{})

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL