Documentation
¶
Index ¶
- Constants
- Variables
- func ErrResult(result C.ma_result) error
- type AllocationCallbacks
- type Backend
- type Channel
- type ChannelMixMode
- type Context
- type ContextConfig
- func (cc *ContextConfig) AlsaUseVerboseDeviceEnumeration() bool
- func (cc *ContextConfig) Close()
- func (cc *ContextConfig) CoreAudioNoAudioSessionActivate() bool
- func (cc *ContextConfig) CoreAudioNoAudioSessionDeactivate() bool
- func (cc *ContextConfig) CoreAudioSessionCategory() C.ma_ios_session_category
- func (cc *ContextConfig) CoreAudioSessionCategoryOptions() uint32
- func (cc *ContextConfig) DSoundHWND() uintptr
- func (cc *ContextConfig) JackClientName() string
- func (cc *ContextConfig) JackTryStartServer() bool
- func (cc *ContextConfig) PLog() *Log
- func (cc *ContextConfig) PUserData() unsafe.Pointer
- func (cc *ContextConfig) PulseApplicationName() string
- func (cc *ContextConfig) PulseServerName() string
- func (cc *ContextConfig) PulseTryAutoSpawn() bool
- func (cc *ContextConfig) SetAlsaUseVerboseDeviceEnumeration(enabled bool)
- func (cc *ContextConfig) SetCoreAudioNoAudioSessionActivate(disabled bool)
- func (cc *ContextConfig) SetCoreAudioNoAudioSessionDeactivate(disabled bool)
- func (cc *ContextConfig) SetCoreAudioSessionCategory(category C.ma_ios_session_category)
- func (cc *ContextConfig) SetCoreAudioSessionCategoryOptions(options uint32)
- func (cc *ContextConfig) SetDSoundHWND(hWnd uintptr)
- func (cc *ContextConfig) SetJackClientName(name string)
- func (cc *ContextConfig) SetJackTryStartServer(enabled bool)
- func (cc *ContextConfig) SetPLog(log *Log)
- func (cc *ContextConfig) SetPUserData(userData unsafe.Pointer)
- func (cc *ContextConfig) SetPulseApplicationName(name string)
- func (cc *ContextConfig) SetPulseServerName(name string)
- func (cc *ContextConfig) SetPulseTryAutoSpawn(enabled bool)
- func (cc *ContextConfig) SetThreadPriority(priority C.ma_thread_priority)
- func (cc *ContextConfig) SetThreadStackSize(size uint64)
- func (cc *ContextConfig) ThreadPriority() C.ma_thread_priority
- func (cc *ContextConfig) ThreadStackSize() uint64
- type DataSource
- type Decoder
- type DecoderConfig
- func (dc *DecoderConfig) ChannelMixMode() ChannelMixMode
- func (dc *DecoderConfig) Channels() uint32
- func (dc *DecoderConfig) Close()
- func (dc *DecoderConfig) CustomBackendCount() uint32
- func (dc *DecoderConfig) DitherMode() DitherMode
- func (dc *DecoderConfig) EncodingFormat() EncodingFormat
- func (dc *DecoderConfig) Format() Format
- func (dc *DecoderConfig) PChannelMap() unsafe.Pointer
- func (dc *DecoderConfig) PCustomBackendUserData() unsafe.Pointer
- func (dc *DecoderConfig) PPCustomBackendVTables() unsafe.Pointer
- func (dc *DecoderConfig) ResamplingChannels() uint32
- func (dc *DecoderConfig) ResamplingFormat() Format
- func (dc *DecoderConfig) ResamplingLPFOrder() uint32
- func (dc *DecoderConfig) ResamplingSampleRateIn() uint32
- func (dc *DecoderConfig) ResamplingSampleRateOut() uint32
- func (dc *DecoderConfig) SampleRate() uint32
- func (dc *DecoderConfig) SeekPointCount() uint32
- func (dc *DecoderConfig) SetChannelMixMode(mode ChannelMixMode)
- func (dc *DecoderConfig) SetChannels(channels uint32)
- func (dc *DecoderConfig) SetCustomBackendCount(count uint32)
- func (dc *DecoderConfig) SetDitherMode(mode DitherMode)
- func (dc *DecoderConfig) SetEncodingFormat(format EncodingFormat)
- func (dc *DecoderConfig) SetFormat(format Format)
- func (dc *DecoderConfig) SetPChannelMap(channelMap unsafe.Pointer)
- func (dc *DecoderConfig) SetPCustomBackendUserData(userData unsafe.Pointer)
- func (dc *DecoderConfig) SetPPCustomBackendVTables(vtables unsafe.Pointer)
- func (dc *DecoderConfig) SetResamplingChannels(channels uint32)
- func (dc *DecoderConfig) SetResamplingFormat(format Format)
- func (dc *DecoderConfig) SetResamplingLPFOrder(order uint32)
- func (dc *DecoderConfig) SetResamplingSampleRateIn(sampleRateIn uint32)
- func (dc *DecoderConfig) SetResamplingSampleRateOut(sampleRateOut uint32)
- func (dc *DecoderConfig) SetSampleRate(sampleRate uint32)
- func (dc *DecoderConfig) SetSeekPointCount(count uint32)
- type Device
- func (d *Device) CaptureChannels() uint32
- func (d *Device) CaptureFormat() Format
- func (d *Device) CaptureSampleRate() uint32
- func (d *Device) Channels() uint32
- func (d *Device) Close()
- func (d *Device) Context() *Context
- func (d *Device) Format() Format
- func (d *Device) GetSampleRate() uint32
- func (d *Device) Start() error
- func (d *Device) Stop() error
- type DeviceConfig
- func (dc *DeviceConfig) AaudioAllowSetBufferCapacity() bool
- func (dc *DeviceConfig) AaudioAllowedCapturePolicy() C.ma_aaudio_allowed_capture_policy
- func (dc *DeviceConfig) AaudioContentType() C.ma_aaudio_content_type
- func (dc *DeviceConfig) AaudioEnableCompatibilityWorkarounds() bool
- func (dc *DeviceConfig) AaudioInputPreset() C.ma_aaudio_input_preset
- func (dc *DeviceConfig) AaudioNoAutoStartAfterReroute() bool
- func (dc *DeviceConfig) AaudioUsage() C.ma_aaudio_usage
- func (dc *DeviceConfig) AlsaNoAutoChannels() bool
- func (dc *DeviceConfig) AlsaNoAutoFormat() bool
- func (dc *DeviceConfig) AlsaNoAutoResample() bool
- func (dc *DeviceConfig) AlsaNoMMap() bool
- func (dc *DeviceConfig) CaptureCalculateLFEFromSpatialChannels() bool
- func (dc *DeviceConfig) CaptureChannelMixMode() ChannelMixMode
- func (dc *DeviceConfig) CaptureChannels() uint32
- func (dc *DeviceConfig) CaptureDeviceID() *DeviceID
- func (dc *DeviceConfig) CaptureFormat() Format
- func (dc *DeviceConfig) CapturePChannelMap() unsafe.Pointer
- func (dc *DeviceConfig) CaptureShareMode() C.ma_share_mode
- func (dc *DeviceConfig) Close()
- func (dc *DeviceConfig) CoreaudioAllowNominalSampleRateChange() bool
- func (dc *DeviceConfig) DataCallback() C.ma_device_data_proc
- func (dc *DeviceConfig) NoClip() bool
- func (dc *DeviceConfig) NoDisableDenormals() bool
- func (dc *DeviceConfig) NoFixedSizedCallback() bool
- func (dc *DeviceConfig) NoPreSilencedOutputBuffer() bool
- func (dc *DeviceConfig) NotificationCallback() C.ma_device_notification_proc
- func (dc *DeviceConfig) OpenslEnableCompatibilityWorkarounds() bool
- func (dc *DeviceConfig) OpenslRecordingPreset() C.ma_opensl_recording_preset
- func (dc *DeviceConfig) OpenslStreamType() C.ma_opensl_stream_type
- func (dc *DeviceConfig) PUserData() unsafe.Pointer
- func (dc *DeviceConfig) PerformanceProfile() C.ma_performance_profile
- func (dc *DeviceConfig) PeriodSizeInFrames() uint32
- func (dc *DeviceConfig) PeriodSizeInMilliseconds() uint32
- func (dc *DeviceConfig) Periods() uint32
- func (dc *DeviceConfig) PlaybackCalculateLFEFromSpatialChannels() bool
- func (dc *DeviceConfig) PlaybackChannelMixMode() ChannelMixMode
- func (dc *DeviceConfig) PlaybackChannels() uint32
- func (dc *DeviceConfig) PlaybackDeviceID() *DeviceID
- func (dc *DeviceConfig) PlaybackFormat() Format
- func (dc *DeviceConfig) PlaybackPChannelMap() unsafe.Pointer
- func (dc *DeviceConfig) PlaybackShareMode() C.ma_share_mode
- func (dc *DeviceConfig) PulseChannelMap() int32
- func (dc *DeviceConfig) PulseStreamNameCapture() string
- func (dc *DeviceConfig) PulseStreamNamePlayback() string
- func (dc *DeviceConfig) SampleRate() uint32
- func (dc *DeviceConfig) SetAaudioAllowSetBufferCapacity(allowed bool)
- func (dc *DeviceConfig) SetAaudioAllowedCapturePolicy(policy C.ma_aaudio_allowed_capture_policy)
- func (dc *DeviceConfig) SetAaudioContentType(contentType C.ma_aaudio_content_type)
- func (dc *DeviceConfig) SetAaudioEnableCompatibilityWorkarounds(enabled bool)
- func (dc *DeviceConfig) SetAaudioInputPreset(preset C.ma_aaudio_input_preset)
- func (dc *DeviceConfig) SetAaudioNoAutoStartAfterReroute(disabled bool)
- func (dc *DeviceConfig) SetAaudioUsage(usage C.ma_aaudio_usage)
- func (dc *DeviceConfig) SetAlsaNoAutoChannels(disabled bool)
- func (dc *DeviceConfig) SetAlsaNoAutoFormat(disabled bool)
- func (dc *DeviceConfig) SetAlsaNoAutoResample(disabled bool)
- func (dc *DeviceConfig) SetAlsaNoMMap(disabled bool)
- func (dc *DeviceConfig) SetCaptureCalculateLFEFromSpatialChannels(enabled bool)
- func (dc *DeviceConfig) SetCaptureChannelMixMode(mode ChannelMixMode)
- func (dc *DeviceConfig) SetCaptureChannels(channels uint32)
- func (dc *DeviceConfig) SetCaptureDeviceID(id *DeviceID)
- func (dc *DeviceConfig) SetCaptureFormat(format Format)
- func (dc *DeviceConfig) SetCapturePChannelMap(channelMap unsafe.Pointer)
- func (dc *DeviceConfig) SetCaptureShareMode(mode C.ma_share_mode)
- func (dc *DeviceConfig) SetCoreaudioAllowNominalSampleRateChange(allowed bool)
- func (dc *DeviceConfig) SetDataCallback(callback C.ma_device_data_proc)
- func (dc *DeviceConfig) SetNoClip(disabled bool)
- func (dc *DeviceConfig) SetNoDisableDenormals(disabled bool)
- func (dc *DeviceConfig) SetNoFixedSizedCallback(enabled bool)
- func (dc *DeviceConfig) SetNoPreSilencedOutputBuffer(disabled bool)
- func (dc *DeviceConfig) SetNotificationCallback(callback C.ma_device_notification_proc)
- func (dc *DeviceConfig) SetOpenslEnableCompatibilityWorkarounds(enabled bool)
- func (dc *DeviceConfig) SetOpenslRecordingPreset(preset C.ma_opensl_recording_preset)
- func (dc *DeviceConfig) SetOpenslStreamType(streamType C.ma_opensl_stream_type)
- func (dc *DeviceConfig) SetPUserData(userData unsafe.Pointer)
- func (dc *DeviceConfig) SetPerformanceProfile(profile C.ma_performance_profile)
- func (dc *DeviceConfig) SetPeriodSizeInFrames(periodSize uint32)
- func (dc *DeviceConfig) SetPeriodSizeInMilliseconds(periodSize uint32)
- func (dc *DeviceConfig) SetPeriods(periods uint32)
- func (dc *DeviceConfig) SetPlaybackCalculateLFEFromSpatialChannels(enabled bool)
- func (dc *DeviceConfig) SetPlaybackChannelMixMode(mode ChannelMixMode)
- func (dc *DeviceConfig) SetPlaybackChannels(channels uint32)
- func (dc *DeviceConfig) SetPlaybackDeviceID(id *DeviceID)
- func (dc *DeviceConfig) SetPlaybackFormat(format Format)
- func (dc *DeviceConfig) SetPlaybackPChannelMap(channelMap unsafe.Pointer)
- func (dc *DeviceConfig) SetPlaybackShareMode(mode C.ma_share_mode)
- func (dc *DeviceConfig) SetPulseChannelMap(channelMap int32)
- func (dc *DeviceConfig) SetPulseStreamNameCapture(name string)
- func (dc *DeviceConfig) SetPulseStreamNamePlayback(name string)
- func (dc *DeviceConfig) SetSampleRate(sampleRate uint32)
- func (dc *DeviceConfig) SetStopCallback(callback C.ma_stop_proc)
- func (dc *DeviceConfig) SetWasapiLoopbackProcessID(id uint32)
- func (dc *DeviceConfig) SetWasapiNoAutoConvertSRC(disabled bool)
- func (dc *DeviceConfig) SetWasapiNoDefaultQualitySRC(disabled bool)
- func (dc *DeviceConfig) SetWasapiNoHardwareOffloading(disabled bool)
- func (dc *DeviceConfig) StopCallback() C.ma_stop_proc
- func (dc *DeviceConfig) WasapiLoopbackProcessID() uint32
- func (dc *DeviceConfig) WasapiNoAutoConvertSRC() bool
- func (dc *DeviceConfig) WasapiNoDefaultQualitySRC() bool
- func (dc *DeviceConfig) WasapiNoHardwareOffloading() bool
- type DeviceDirection
- type DeviceID
- type DeviceType
- type DitherMode
- type EncodingFormat
- type Engine
- func (e *Engine) Channels() uint32
- func (e *Engine) Close()
- func (e *Engine) CopySound(existing *Sound, flags SoundFlags, group *Sound) (*Sound, error)
- func (e *Engine) Endpoint() *Node
- func (e *Engine) FindClosestListener(x, y, z float32) uint32
- func (e *Engine) GainDB() float32
- func (e *Engine) GetDevice() *C.ma_device
- func (e *Engine) ListenerCone(listenerIndex uint32) (innerAngle, outerAngle, outerGain float32)
- func (e *Engine) ListenerCount() uint32
- func (e *Engine) ListenerDirection(listenerIndex uint32) (x, y, z float32)
- func (e *Engine) ListenerIsEnabled(listenerIndex uint32) bool
- func (e *Engine) ListenerPosition(listenerIndex uint32) (x, y, z float32)
- func (e *Engine) ListenerSetCone(listenerIndex uint32, innerAngle, outerAngle, outerGain float32) error
- func (e *Engine) ListenerSetDirection(listenerIndex uint32, x, y, z float32) error
- func (e *Engine) ListenerSetEnabled(listenerIndex uint32, enabled bool) error
- func (e *Engine) ListenerSetPosition(listenerIndex uint32, x, y, z float32) error
- func (e *Engine) ListenerSetVelocity(listenerIndex uint32, x, y, z float32) error
- func (e *Engine) ListenerSetWorldUp(listenerIndex uint32, x, y, z float32) error
- func (e *Engine) ListenerVelocity(listenerIndex uint32) (x, y, z float32)
- func (e *Engine) Log() *C.ma_log
- func (e *Engine) NodeGraph() *C.ma_node_graph
- func (e *Engine) PlaySound(filePath string) error
- func (e *Engine) PlaySoundEx(filePath string, pNode *Node, nodeInputBusIndex uint32) error
- func (e *Engine) PlaySoundFromDataSource(dataSource DataSource, flags SoundFlags, group *Sound) (*Sound, error)
- func (e *Engine) PlaySoundFromFile(filePath string, flags SoundFlags, group *Sound, doneFence unsafe.Pointer) (*Sound, error)
- func (e *Engine) ReadPCMFrames(frameCount uint64, pFramesOut []float32) (framesRead uint64, err error)
- func (e *Engine) ResourceManager() *C.ma_resource_manager
- func (e *Engine) SampleRate() uint32
- func (e *Engine) SetGainDB(gainDB float32) error
- func (e *Engine) SetTime(time uint64) error
- func (e *Engine) SetTimeInMilliseconds(time uint64) error
- func (e *Engine) SetTimeInPCMFrames(time uint64) error
- func (e *Engine) SetVolume(volume float32) error
- func (e *Engine) Start() error
- func (e *Engine) Stop() error
- func (e *Engine) Time() uint64
- func (e *Engine) TimeInMilliseconds() uint64
- func (e *Engine) TimeInPCMFrames() uint64
- func (e *Engine) Volume() float32
- type EngineConfig
- func (ec *EngineConfig) Channels() uint32
- func (ec *EngineConfig) Close()
- func (ec *EngineConfig) DataCallback() C.ma_device_data_proc
- func (ec *EngineConfig) DefaultVolumeSmoothTimeInPCMFrames() uint32
- func (ec *EngineConfig) GainSmoothTimeInFrames() uint32
- func (ec *EngineConfig) GainSmoothTimeInMilliseconds() uint32
- func (ec *EngineConfig) ListenerCount() uint32
- func (ec *EngineConfig) MonoExpansionMode() uint32
- func (ec *EngineConfig) NoAutoStart() bool
- func (ec *EngineConfig) NoDevice() bool
- func (ec *EngineConfig) NotificationCallback() C.ma_device_notification_proc
- func (ec *EngineConfig) OnProcess() C.ma_engine_process_proc
- func (ec *EngineConfig) PContext() *Context
- func (ec *EngineConfig) PDevice() *Device
- func (ec *EngineConfig) PLog() *Log
- func (ec *EngineConfig) PProcessUserData() unsafe.Pointer
- func (ec *EngineConfig) PaymentDeviceID() *DeviceID
- func (ec *EngineConfig) PeriodSizeInFrames() uint32
- func (ec *EngineConfig) PeriodSizeInMilliseconds() uint32
- func (ec *EngineConfig) PreMixStackSizeInBytes() uint32
- func (ec *EngineConfig) SampleRate() uint32
- func (ec *EngineConfig) SetChannels(channels uint32)
- func (ec *EngineConfig) SetDataCallback(callback C.ma_device_data_proc)
- func (ec *EngineConfig) SetDefaultVolumeSmoothTimeInPCMFrames(frames uint32)
- func (ec *EngineConfig) SetGainSmoothTimeInFrames(frames uint32)
- func (ec *EngineConfig) SetGainSmoothTimeInMilliseconds(milliseconds uint32)
- func (ec *EngineConfig) SetListenerCount(count uint32)
- func (ec *EngineConfig) SetMonoExpansionMode(mode uint32)
- func (ec *EngineConfig) SetNoAutoStart(noAutoStart bool)
- func (ec *EngineConfig) SetNoDevice(noDevice bool)
- func (ec *EngineConfig) SetNotificationCallback(callback C.ma_device_notification_proc)
- func (ec *EngineConfig) SetOnProcess(callback C.ma_engine_process_proc)
- func (ec *EngineConfig) SetPContext(ctx *Context)
- func (ec *EngineConfig) SetPDevice(device *Device)
- func (ec *EngineConfig) SetPLog(log *Log)
- func (ec *EngineConfig) SetPPaymentDeviceID(deviceID *DeviceID)
- func (ec *EngineConfig) SetPProcessUserData(userData unsafe.Pointer)
- func (ec *EngineConfig) SetPeriodSizeInFrames(periodSize uint32)
- func (ec *EngineConfig) SetPeriodSizeInMilliseconds(periodSize uint32)
- func (ec *EngineConfig) SetPreMixStackSizeInBytes(size uint32)
- func (ec *EngineConfig) SetSampleRate(sampleRate uint32)
- type EngineError
- type Format
- type Log
- type Node
- type NodeGraph
- func (ng *NodeGraph) Channels() uint32
- func (ng *NodeGraph) Close()
- func (ng *NodeGraph) Endpoint() *Node
- func (ng *NodeGraph) ProcessingSizeInFrames() uint32
- func (ng *NodeGraph) ReadPCMFrames(framesOut []float32, frameCount uint64) (uint64, error)
- func (ng *NodeGraph) SetTime(globalTime uint64) error
- func (ng *NodeGraph) Time() uint64
- type NodeGraphConfig
- type NodeState
- type ResamplerQuality
- type ReverveNode
- func (n *ReverveNode) Close()
- func (n *ReverveNode) Damping() float32
- func (n *ReverveNode) DryVolume() float32
- func (n *ReverveNode) Mode() float32
- func (n *ReverveNode) RoomSize() float32
- func (n *ReverveNode) SetDamping(damping float32)
- func (n *ReverveNode) SetDryVolume(dryVolume float32)
- func (n *ReverveNode) SetMode(mode float32)
- func (n *ReverveNode) SetRoomSize(roomSize float32)
- func (n *ReverveNode) SetWetVolume(wetVolume float32)
- func (n *ReverveNode) SetWidth(width float32)
- func (n *ReverveNode) WetVolume() float32
- func (n *ReverveNode) Width() float32
- type ReverveNodeConfig
- func (c *ReverveNodeConfig) Damping() float32
- func (c *ReverveNodeConfig) DryVolume() float32
- func (c *ReverveNodeConfig) Free()
- func (c *ReverveNodeConfig) Mode() float32
- func (c *ReverveNodeConfig) RoomSize() float32
- func (c *ReverveNodeConfig) SetDamping(damping float32)
- func (c *ReverveNodeConfig) SetDryVolume(dryVolume float32)
- func (c *ReverveNodeConfig) SetMode(mode float32)
- func (c *ReverveNodeConfig) SetRoomSize(roomSize float32)
- func (c *ReverveNodeConfig) SetWetVolume(wetVolume float32)
- func (c *ReverveNodeConfig) SetWidth(width float32)
- func (c *ReverveNodeConfig) WetVolume() float32
- func (c *ReverveNodeConfig) Width() float32
- type SeekOrigin
- type Sound
- func (s *Sound) Close()
- func (s *Sound) DataSource() unsafe.Pointer
- func (s *Sound) Engine() *Engine
- func (s *Sound) IsPlaying() bool
- func (s *Sound) IsSpatializationEnabled() bool
- func (s *Sound) Pan() float32
- func (s *Sound) Pitch() float32
- func (s *Sound) Position() (x, y, z float32)
- func (s *Sound) ResetStartTime()
- func (s *Sound) ResetStopTime()
- func (s *Sound) SetPan(pan float32)
- func (s *Sound) SetPitch(pitch float32)
- func (s *Sound) SetPosition(x, y, z float32)
- func (s *Sound) SetSpatializationEnabled(enabled bool)
- func (s *Sound) SetVolume(volume float32)
- func (s *Sound) Start() error
- func (s *Sound) Stop() error
- func (s *Sound) Volume() float32
- type SoundConfig
- type SoundFlags
Constants ¶
const ( MA_SUCCESS = 0 MA_ERROR = -1 MA_INVALID_ARGS = -2 MA_NO_MEMORY = -3 MA_OUT_OF_RANGE = -4 MA_ALREADY_INITIALIZED = -5 MA_NOT_FOUND = -6 MA_INVALID_OPERATION = -7 MA_INVALID_STATE = -8 MA_AUDIO_NOT_AVAILABLE = -9 MA_BACKEND_NOT_AVAILABLE = -10 MA_NO_DATA = -11 MA_ALREADY_EOS = -12 MA_AT_END = 0x1 MA_NOT_IMPLEMENTED = -13 )
Variables ¶
var ErrNilEngine = &EngineError{msg: "engine is nil"}
ErrNilEngine is returned when the engine is nil.
Functions ¶
Types ¶
type AllocationCallbacks ¶
type AllocationCallbacks struct {
// contains filtered or unexported fields
}
func NewAllocationCallbacks ¶
func NewAllocationCallbacks() *AllocationCallbacks
func (*AllocationCallbacks) Close ¶
func (c *AllocationCallbacks) Close()
type Backend ¶
type Backend int32
Backend represents available audio backends.
const ( BackendNone Backend = 0 BackendWASAPI Backend = 1 << 0 BackendDirectSound Backend = 1 << 1 BackendMME Backend = 1 << 2 BackendAudioIO Backend = 1 << 3 BackendPortAudio Backend = 1 << 4 BackendALSA Backend = 1 << 5 BackendPulseAudio Backend = 1 << 6 BackendCoreAudio Backend = 1 << 7 BackendJACK Backend = 1 << 8 BackendOSS Backend = 1 << 9 BackendNaCl Backend = 1 << 10 )
type Channel ¶
type Channel int32
Channel represents ma_channel enum values.
const ( ChannelMono Channel = 1 ChannelFrontLeft Channel = 2 ChannelFrontRight Channel = 3 ChannelFrontCenter Channel = 4 ChannelBackCenter Channel = 5 ChannelBackLeft Channel = 6 ChannelBackRight Channel = 7 ChannelFrontLeftOfCenter Channel = 8 ChannelFrontRightOfCenter Channel = 9 ChannelBackLeftOfCenter Channel = 10 ChannelBackRightOfCenter Channel = 11 ChannelSideLeft Channel = 12 ChannelSideRight Channel = 13 ChannelLFE1 Channel = 14 ChannelStereoLeft Channel = 15 ChannelStereoRight Channel = 16 )
type ChannelMixMode ¶
type ChannelMixMode int32
ChannelMixMode represents ma_channel_mix_mode enum values.
const ( ChannelMixModeDefault ChannelMixMode = 0 ChannelMixModeStrict ChannelMixMode = 1 ChannelMixModeAllowLosses ChannelMixMode = 2 )
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context wraps ma_context.
func NewContext ¶
func NewContext(backends []C.ma_backend, config *ContextConfig) (*Context, error)
NewContext creates a new Context instance, initializes it with ma_context_init, and returns it. The backends parameter specifies which backends to use. If nil, miniaudio's default priorities are used. The config parameter can be nil for defaults.
func (*Context) Backend ¶
func (c *Context) Backend() C.ma_backend
Backend returns the backend of the context.
func (*Context) Close ¶
func (c *Context) Close()
Close uninitializes and releases the context memory.
func (*Context) Devices ¶
func (c *Context) Devices() (playbackInfo unsafe.Pointer, playbackCount uint32, captureInfo unsafe.Pointer, captureCount uint32, err error)
Devices retrieves the devices from the context. It returns playback infos pointer, playback count, capture infos pointer, and capture count. Do not free the returned buffers as their memory is managed internally by miniaudio.
type ContextConfig ¶
type ContextConfig struct {
// contains filtered or unexported fields
}
ContextConfig wraps ma_context_config.
func NewContextConfig ¶
func NewContextConfig() *ContextConfig
NewContextConfig creates a new ContextConfig and calls ma_context_config_init.
func (*ContextConfig) AlsaUseVerboseDeviceEnumeration ¶
func (cc *ContextConfig) AlsaUseVerboseDeviceEnumeration() bool
AlsaUseVerboseDeviceEnumeration returns whether verbose device enumeration is enabled for ALSA.
func (*ContextConfig) Close ¶
func (cc *ContextConfig) Close()
func (*ContextConfig) CoreAudioNoAudioSessionActivate ¶
func (cc *ContextConfig) CoreAudioNoAudioSessionActivate() bool
CoreAudioNoAudioSessionActivate returns whether audio session activation is disabled for iOS.
func (*ContextConfig) CoreAudioNoAudioSessionDeactivate ¶
func (cc *ContextConfig) CoreAudioNoAudioSessionDeactivate() bool
CoreAudioNoAudioSessionDeactivate returns whether audio session deactivation is disabled for iOS.
func (*ContextConfig) CoreAudioSessionCategory ¶
func (cc *ContextConfig) CoreAudioSessionCategory() C.ma_ios_session_category
CoreAudioSessionCategory returns the CoreAudio session category.
func (*ContextConfig) CoreAudioSessionCategoryOptions ¶
func (cc *ContextConfig) CoreAudioSessionCategoryOptions() uint32
CoreAudioSessionCategoryOptions returns the CoreAudio session category options.
func (*ContextConfig) DSoundHWND ¶
func (cc *ContextConfig) DSoundHWND() uintptr
DSoundHWND returns the Windows window handle for DirectSound.
func (*ContextConfig) JackClientName ¶
func (cc *ContextConfig) JackClientName() string
JackClientName returns the JACK client name.
func (*ContextConfig) JackTryStartServer ¶
func (cc *ContextConfig) JackTryStartServer() bool
JackTryStartServer returns whether auto-starting the server is enabled for JACK.
func (*ContextConfig) PUserData ¶
func (cc *ContextConfig) PUserData() unsafe.Pointer
PUserData returns the user data pointer.
func (*ContextConfig) PulseApplicationName ¶
func (cc *ContextConfig) PulseApplicationName() string
PulseApplicationName returns the PulseAudio application name.
func (*ContextConfig) PulseServerName ¶
func (cc *ContextConfig) PulseServerName() string
PulseServerName returns the PulseAudio server name.
func (*ContextConfig) PulseTryAutoSpawn ¶
func (cc *ContextConfig) PulseTryAutoSpawn() bool
PulseTryAutoSpawn returns whether auto-spawning is enabled for PulseAudio.
func (*ContextConfig) SetAlsaUseVerboseDeviceEnumeration ¶
func (cc *ContextConfig) SetAlsaUseVerboseDeviceEnumeration(enabled bool)
SetAlsaUseVerboseDeviceEnumeration sets whether verbose device enumeration is enabled for ALSA.
func (*ContextConfig) SetCoreAudioNoAudioSessionActivate ¶
func (cc *ContextConfig) SetCoreAudioNoAudioSessionActivate(disabled bool)
SetCoreAudioNoAudioSessionActivate sets whether audio session activation is disabled for iOS.
func (*ContextConfig) SetCoreAudioNoAudioSessionDeactivate ¶
func (cc *ContextConfig) SetCoreAudioNoAudioSessionDeactivate(disabled bool)
SetCoreAudioNoAudioSessionDeactivate sets whether audio session deactivation is disabled for iOS.
func (*ContextConfig) SetCoreAudioSessionCategory ¶
func (cc *ContextConfig) SetCoreAudioSessionCategory(category C.ma_ios_session_category)
SetCoreAudioSessionCategory sets the CoreAudio session category.
func (*ContextConfig) SetCoreAudioSessionCategoryOptions ¶
func (cc *ContextConfig) SetCoreAudioSessionCategoryOptions(options uint32)
SetCoreAudioSessionCategoryOptions sets the CoreAudio session category options.
func (*ContextConfig) SetDSoundHWND ¶
func (cc *ContextConfig) SetDSoundHWND(hWnd uintptr)
SetDSoundHWND sets the Windows window handle for DirectSound.
func (*ContextConfig) SetJackClientName ¶
func (cc *ContextConfig) SetJackClientName(name string)
SetJackClientName sets the JACK client name.
func (*ContextConfig) SetJackTryStartServer ¶
func (cc *ContextConfig) SetJackTryStartServer(enabled bool)
SetJackTryStartServer sets whether auto-starting the server is enabled for JACK.
func (*ContextConfig) SetPLog ¶
func (cc *ContextConfig) SetPLog(log *Log)
SetPLog sets the log pointer.
func (*ContextConfig) SetPUserData ¶
func (cc *ContextConfig) SetPUserData(userData unsafe.Pointer)
SetPUserData sets the user data pointer.
func (*ContextConfig) SetPulseApplicationName ¶
func (cc *ContextConfig) SetPulseApplicationName(name string)
SetPulseApplicationName sets the PulseAudio application name.
func (*ContextConfig) SetPulseServerName ¶
func (cc *ContextConfig) SetPulseServerName(name string)
SetPulseServerName sets the PulseAudio server name.
func (*ContextConfig) SetPulseTryAutoSpawn ¶
func (cc *ContextConfig) SetPulseTryAutoSpawn(enabled bool)
SetPulseTryAutoSpawn sets whether auto-spawning is enabled for PulseAudio.
func (*ContextConfig) SetThreadPriority ¶
func (cc *ContextConfig) SetThreadPriority(priority C.ma_thread_priority)
SetThreadPriority sets the thread priority.
func (*ContextConfig) SetThreadStackSize ¶
func (cc *ContextConfig) SetThreadStackSize(size uint64)
SetThreadStackSize sets the thread stack size.
func (*ContextConfig) ThreadPriority ¶
func (cc *ContextConfig) ThreadPriority() C.ma_thread_priority
ThreadPriority returns the thread priority.
func (*ContextConfig) ThreadStackSize ¶
func (cc *ContextConfig) ThreadStackSize() uint64
ThreadStackSize returns the thread stack size.
type DataSource ¶
type DataSource interface {
// contains filtered or unexported methods
}
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder wraps ma_decoder.
func NewDecoderFromFile ¶
func NewDecoderFromFile(filePath string, config *DecoderConfig) (*Decoder, error)
NewDecoderFromFile creates a new Decoder from a file path and initializes it with ma_decoder_init_file.
func NewDecoderFromMemory ¶
func NewDecoderFromMemory(data []byte, config *DecoderConfig) (*Decoder, error)
NewDecoderFromMemory creates a new Decoder from a byte slice and initializes it with ma_decoder_init_memory.
func (*Decoder) Close ¶
func (d *Decoder) Close()
Close uninitializes and releases the decoder memory.
func (*Decoder) LengthInPCMFrames ¶
LengthInPCMFrames returns the length in PCM frames of the decoded data.
func (*Decoder) PositionInPCMFrames ¶
PositionInPCMFrames returns the current position in PCM frames.
func (*Decoder) ReadPCMFrames ¶
ReadPCMFrames reads PCM frames from the decoder.
func (*Decoder) SeekToPCMFrame ¶
SeekToPCMFrame seeks to a specific PCM frame position.
type DecoderConfig ¶
type DecoderConfig struct {
// contains filtered or unexported fields
}
DecoderConfig wraps ma_decoder_config.
func NewDecoderConfig ¶
func NewDecoderConfig(format Format, channels uint32, sampleRate uint32) *DecoderConfig
NewDecoderConfig creates a new DecoderConfig and calls ma_decoder_config_init.
func (*DecoderConfig) ChannelMixMode ¶
func (dc *DecoderConfig) ChannelMixMode() ChannelMixMode
ChannelMixMode returns the channel mix mode.
func (*DecoderConfig) Channels ¶
func (dc *DecoderConfig) Channels() uint32
Channels returns the output channel count.
func (*DecoderConfig) Close ¶
func (dc *DecoderConfig) Close()
func (*DecoderConfig) CustomBackendCount ¶
func (dc *DecoderConfig) CustomBackendCount() uint32
CustomBackendCount returns the custom backend count.
func (*DecoderConfig) DitherMode ¶
func (dc *DecoderConfig) DitherMode() DitherMode
DitherMode returns the dither mode.
func (*DecoderConfig) EncodingFormat ¶
func (dc *DecoderConfig) EncodingFormat() EncodingFormat
EncodingFormat returns the encoding format.
func (*DecoderConfig) Format ¶
func (dc *DecoderConfig) Format() Format
Format returns the output format.
func (*DecoderConfig) PChannelMap ¶
func (dc *DecoderConfig) PChannelMap() unsafe.Pointer
PChannelMap returns the channel map pointer.
func (*DecoderConfig) PCustomBackendUserData ¶
func (dc *DecoderConfig) PCustomBackendUserData() unsafe.Pointer
PCustomBackendUserData returns the custom backend user data pointer.
func (*DecoderConfig) PPCustomBackendVTables ¶
func (dc *DecoderConfig) PPCustomBackendVTables() unsafe.Pointer
PPCustomBackendVTables returns the custom backend vtable pointers.
func (*DecoderConfig) ResamplingChannels ¶
func (dc *DecoderConfig) ResamplingChannels() uint32
ResamplingChannels returns the resampling channel count.
func (*DecoderConfig) ResamplingFormat ¶
func (dc *DecoderConfig) ResamplingFormat() Format
ResamplingFormat returns the resampling format.
func (*DecoderConfig) ResamplingLPFOrder ¶
func (dc *DecoderConfig) ResamplingLPFOrder() uint32
ResamplingLPFOrder returns the resampling LPF order.
func (*DecoderConfig) ResamplingSampleRateIn ¶
func (dc *DecoderConfig) ResamplingSampleRateIn() uint32
ResamplingSampleRateIn returns the resampling input sample rate.
func (*DecoderConfig) ResamplingSampleRateOut ¶
func (dc *DecoderConfig) ResamplingSampleRateOut() uint32
ResamplingSampleRateOut returns the resampling output sample rate.
func (*DecoderConfig) SampleRate ¶
func (dc *DecoderConfig) SampleRate() uint32
SampleRate returns the output sample rate.
func (*DecoderConfig) SeekPointCount ¶
func (dc *DecoderConfig) SeekPointCount() uint32
SeekPointCount returns the seek point count.
func (*DecoderConfig) SetChannelMixMode ¶
func (dc *DecoderConfig) SetChannelMixMode(mode ChannelMixMode)
SetChannelMixMode sets the channel mix mode.
func (*DecoderConfig) SetChannels ¶
func (dc *DecoderConfig) SetChannels(channels uint32)
SetChannels sets the output channel count.
func (*DecoderConfig) SetCustomBackendCount ¶
func (dc *DecoderConfig) SetCustomBackendCount(count uint32)
SetCustomBackendCount sets the custom backend count.
func (*DecoderConfig) SetDitherMode ¶
func (dc *DecoderConfig) SetDitherMode(mode DitherMode)
SetDitherMode sets the dither mode.
func (*DecoderConfig) SetEncodingFormat ¶
func (dc *DecoderConfig) SetEncodingFormat(format EncodingFormat)
SetEncodingFormat sets the encoding format.
func (*DecoderConfig) SetFormat ¶
func (dc *DecoderConfig) SetFormat(format Format)
SetFormat sets the output format.
func (*DecoderConfig) SetPChannelMap ¶
func (dc *DecoderConfig) SetPChannelMap(channelMap unsafe.Pointer)
SetPChannelMap sets the channel map pointer.
func (*DecoderConfig) SetPCustomBackendUserData ¶
func (dc *DecoderConfig) SetPCustomBackendUserData(userData unsafe.Pointer)
SetPCustomBackendUserData sets the custom backend user data pointer.
func (*DecoderConfig) SetPPCustomBackendVTables ¶
func (dc *DecoderConfig) SetPPCustomBackendVTables(vtables unsafe.Pointer)
SetPPCustomBackendVTables sets the custom backend vtable pointers.
func (*DecoderConfig) SetResamplingChannels ¶
func (dc *DecoderConfig) SetResamplingChannels(channels uint32)
SetResamplingChannels sets the resampling channel count.
func (*DecoderConfig) SetResamplingFormat ¶
func (dc *DecoderConfig) SetResamplingFormat(format Format)
SetResamplingFormat sets the resampling format.
func (*DecoderConfig) SetResamplingLPFOrder ¶
func (dc *DecoderConfig) SetResamplingLPFOrder(order uint32)
SetResamplingLPFOrder sets the resampling LPF order.
func (*DecoderConfig) SetResamplingSampleRateIn ¶
func (dc *DecoderConfig) SetResamplingSampleRateIn(sampleRateIn uint32)
SetResamplingSampleRateIn sets the resampling input sample rate.
func (*DecoderConfig) SetResamplingSampleRateOut ¶
func (dc *DecoderConfig) SetResamplingSampleRateOut(sampleRateOut uint32)
SetResamplingSampleRateOut sets the resampling output sample rate.
func (*DecoderConfig) SetSampleRate ¶
func (dc *DecoderConfig) SetSampleRate(sampleRate uint32)
SetSampleRate sets the output sample rate.
func (*DecoderConfig) SetSeekPointCount ¶
func (dc *DecoderConfig) SetSeekPointCount(count uint32)
SetSeekPointCount sets the seek point count.
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device wraps ma_device.
func NewDevice ¶
func NewDevice(backends []C.ma_backend, config *DeviceConfig) (*Device, error)
NewDevice creates a new Device instance without a context, initializes it with ma_device_init_ex, and returns it.
func NewDeviceWithContext ¶
func NewDeviceWithContext(ctx *Context, config *DeviceConfig) (*Device, error)
NewDeviceWithContext creates a new Device instance using the given context, initializes it with ma_device_init, and returns it.
func (*Device) CaptureChannels ¶
CaptureChannels returns the capture channel count of the device.
func (*Device) CaptureFormat ¶
CaptureFormat returns the capture format of the device.
func (*Device) CaptureSampleRate ¶
CaptureSampleRate returns the capture sample rate of the device.
func (*Device) GetSampleRate ¶
GetSampleRate returns the sample rate of the device.
type DeviceConfig ¶
type DeviceConfig struct {
// contains filtered or unexported fields
}
DeviceConfig wraps ma_device_config.
func NewDeviceConfig ¶
func NewDeviceConfig(deviceType DeviceType) *DeviceConfig
NewDeviceConfig creates a new DeviceConfig and calls ma_device_config_init with the given device type.
func (*DeviceConfig) AaudioAllowSetBufferCapacity ¶
func (dc *DeviceConfig) AaudioAllowSetBufferCapacity() bool
AaudioAllowSetBufferCapacity returns whether setting buffer capacity is allowed for AAudio.
func (*DeviceConfig) AaudioAllowedCapturePolicy ¶
func (dc *DeviceConfig) AaudioAllowedCapturePolicy() C.ma_aaudio_allowed_capture_policy
AaudioAllowedCapturePolicy returns the AAudio allowed capture policy.
func (*DeviceConfig) AaudioContentType ¶
func (dc *DeviceConfig) AaudioContentType() C.ma_aaudio_content_type
AaudioContentType returns the AAudio content type.
func (*DeviceConfig) AaudioEnableCompatibilityWorkarounds ¶
func (dc *DeviceConfig) AaudioEnableCompatibilityWorkarounds() bool
AaudioEnableCompatibilityWorkarounds returns whether compatibility workarounds are enabled for AAudio.
func (*DeviceConfig) AaudioInputPreset ¶
func (dc *DeviceConfig) AaudioInputPreset() C.ma_aaudio_input_preset
AaudioInputPreset returns the AAudio input preset.
func (*DeviceConfig) AaudioNoAutoStartAfterReroute ¶
func (dc *DeviceConfig) AaudioNoAutoStartAfterReroute() bool
AaudioNoAutoStartAfterReroute returns whether auto start after reroute is disabled for AAudio.
func (*DeviceConfig) AaudioUsage ¶
func (dc *DeviceConfig) AaudioUsage() C.ma_aaudio_usage
AaudioUsage returns the AAudio usage.
func (*DeviceConfig) AlsaNoAutoChannels ¶
func (dc *DeviceConfig) AlsaNoAutoChannels() bool
AlsaNoAutoChannels returns whether auto channels is disabled for ALSA.
func (*DeviceConfig) AlsaNoAutoFormat ¶
func (dc *DeviceConfig) AlsaNoAutoFormat() bool
AlsaNoAutoFormat returns whether auto format is disabled for ALSA.
func (*DeviceConfig) AlsaNoAutoResample ¶
func (dc *DeviceConfig) AlsaNoAutoResample() bool
AlsaNoAutoResample returns whether auto resample is disabled for ALSA.
func (*DeviceConfig) AlsaNoMMap ¶
func (dc *DeviceConfig) AlsaNoMMap() bool
AlsaNoMMap returns whether MMap is disabled for ALSA.
func (*DeviceConfig) CaptureCalculateLFEFromSpatialChannels ¶
func (dc *DeviceConfig) CaptureCalculateLFEFromSpatialChannels() bool
CaptureCalculateLFEFromSpatialChannels returns whether LFE calculation from spatial channels is enabled.
func (*DeviceConfig) CaptureChannelMixMode ¶
func (dc *DeviceConfig) CaptureChannelMixMode() ChannelMixMode
CaptureChannelMixMode returns the capture channel mix mode.
func (*DeviceConfig) CaptureChannels ¶
func (dc *DeviceConfig) CaptureChannels() uint32
CaptureChannels returns the capture channel count.
func (*DeviceConfig) CaptureDeviceID ¶
func (dc *DeviceConfig) CaptureDeviceID() *DeviceID
CaptureDeviceID returns the capture device ID.
func (*DeviceConfig) CaptureFormat ¶
func (dc *DeviceConfig) CaptureFormat() Format
CaptureFormat returns the capture format.
func (*DeviceConfig) CapturePChannelMap ¶
func (dc *DeviceConfig) CapturePChannelMap() unsafe.Pointer
CapturePChannelMap returns the capture channel map pointer.
func (*DeviceConfig) CaptureShareMode ¶
func (dc *DeviceConfig) CaptureShareMode() C.ma_share_mode
CaptureShareMode returns the capture share mode.
func (*DeviceConfig) Close ¶
func (dc *DeviceConfig) Close()
func (*DeviceConfig) CoreaudioAllowNominalSampleRateChange ¶
func (dc *DeviceConfig) CoreaudioAllowNominalSampleRateChange() bool
CoreaudioAllowNominalSampleRateChange returns whether nominal sample rate change is allowed for CoreAudio.
func (*DeviceConfig) DataCallback ¶
func (dc *DeviceConfig) DataCallback() C.ma_device_data_proc
DataCallback returns the data callback.
func (*DeviceConfig) NoClip ¶
func (dc *DeviceConfig) NoClip() bool
NoClip returns whether clipping is disabled.
func (*DeviceConfig) NoDisableDenormals ¶
func (dc *DeviceConfig) NoDisableDenormals() bool
NoDisableDenormals returns whether denormal disabling is disabled.
func (*DeviceConfig) NoFixedSizedCallback ¶
func (dc *DeviceConfig) NoFixedSizedCallback() bool
NoFixedSizedCallback returns whether fixed-sized callback disabling is enabled.
func (*DeviceConfig) NoPreSilencedOutputBuffer ¶
func (dc *DeviceConfig) NoPreSilencedOutputBuffer() bool
NoPreSilencedOutputBuffer returns whether pre-silencing of output buffer is disabled.
func (*DeviceConfig) NotificationCallback ¶
func (dc *DeviceConfig) NotificationCallback() C.ma_device_notification_proc
NotificationCallback returns the notification callback.
func (*DeviceConfig) OpenslEnableCompatibilityWorkarounds ¶
func (dc *DeviceConfig) OpenslEnableCompatibilityWorkarounds() bool
OpenslEnableCompatibilityWorkarounds returns whether compatibility workarounds are enabled for OpenSL.
func (*DeviceConfig) OpenslRecordingPreset ¶
func (dc *DeviceConfig) OpenslRecordingPreset() C.ma_opensl_recording_preset
OpenslRecordingPreset returns the OpenSL recording preset.
func (*DeviceConfig) OpenslStreamType ¶
func (dc *DeviceConfig) OpenslStreamType() C.ma_opensl_stream_type
OpenslStreamType returns the OpenSL stream type.
func (*DeviceConfig) PUserData ¶
func (dc *DeviceConfig) PUserData() unsafe.Pointer
PUserData returns the user data pointer.
func (*DeviceConfig) PerformanceProfile ¶
func (dc *DeviceConfig) PerformanceProfile() C.ma_performance_profile
PerformanceProfile returns the performance profile.
func (*DeviceConfig) PeriodSizeInFrames ¶
func (dc *DeviceConfig) PeriodSizeInFrames() uint32
PeriodSizeInFrames returns the period size in frames.
func (*DeviceConfig) PeriodSizeInMilliseconds ¶
func (dc *DeviceConfig) PeriodSizeInMilliseconds() uint32
PeriodSizeInMilliseconds returns the period size in milliseconds.
func (*DeviceConfig) Periods ¶
func (dc *DeviceConfig) Periods() uint32
Periods returns the periods count.
func (*DeviceConfig) PlaybackCalculateLFEFromSpatialChannels ¶
func (dc *DeviceConfig) PlaybackCalculateLFEFromSpatialChannels() bool
PlaybackCalculateLFEFromSpatialChannels returns whether LFE calculation from spatial channels is enabled.
func (*DeviceConfig) PlaybackChannelMixMode ¶
func (dc *DeviceConfig) PlaybackChannelMixMode() ChannelMixMode
PlaybackChannelMixMode returns the playback channel mix mode.
func (*DeviceConfig) PlaybackChannels ¶
func (dc *DeviceConfig) PlaybackChannels() uint32
PlaybackChannels returns the playback channel count.
func (*DeviceConfig) PlaybackDeviceID ¶
func (dc *DeviceConfig) PlaybackDeviceID() *DeviceID
PlaybackDeviceID returns the playback device ID.
func (*DeviceConfig) PlaybackFormat ¶
func (dc *DeviceConfig) PlaybackFormat() Format
PlaybackFormat returns the playback format.
func (*DeviceConfig) PlaybackPChannelMap ¶
func (dc *DeviceConfig) PlaybackPChannelMap() unsafe.Pointer
PlaybackPChannelMap returns the playback channel map pointer.
func (*DeviceConfig) PlaybackShareMode ¶
func (dc *DeviceConfig) PlaybackShareMode() C.ma_share_mode
PlaybackShareMode returns the playback share mode.
func (*DeviceConfig) PulseChannelMap ¶
func (dc *DeviceConfig) PulseChannelMap() int32
PulseChannelMap returns the PulseAudio channel map setting.
func (*DeviceConfig) PulseStreamNameCapture ¶
func (dc *DeviceConfig) PulseStreamNameCapture() string
PulseStreamNameCapture returns the PulseAudio capture stream name.
func (*DeviceConfig) PulseStreamNamePlayback ¶
func (dc *DeviceConfig) PulseStreamNamePlayback() string
PulseStreamNamePlayback returns the PulseAudio playback stream name.
func (*DeviceConfig) SampleRate ¶
func (dc *DeviceConfig) SampleRate() uint32
SampleRate returns the sample rate.
func (*DeviceConfig) SetAaudioAllowSetBufferCapacity ¶
func (dc *DeviceConfig) SetAaudioAllowSetBufferCapacity(allowed bool)
SetAaudioAllowSetBufferCapacity sets whether setting buffer capacity is allowed for AAudio.
func (*DeviceConfig) SetAaudioAllowedCapturePolicy ¶
func (dc *DeviceConfig) SetAaudioAllowedCapturePolicy(policy C.ma_aaudio_allowed_capture_policy)
SetAaudioAllowedCapturePolicy sets the AAudio allowed capture policy.
func (*DeviceConfig) SetAaudioContentType ¶
func (dc *DeviceConfig) SetAaudioContentType(contentType C.ma_aaudio_content_type)
SetAaudioContentType sets the AAudio content type.
func (*DeviceConfig) SetAaudioEnableCompatibilityWorkarounds ¶
func (dc *DeviceConfig) SetAaudioEnableCompatibilityWorkarounds(enabled bool)
SetAaudioEnableCompatibilityWorkarounds sets whether compatibility workarounds are enabled for AAudio.
func (*DeviceConfig) SetAaudioInputPreset ¶
func (dc *DeviceConfig) SetAaudioInputPreset(preset C.ma_aaudio_input_preset)
SetAaudioInputPreset sets the AAudio input preset.
func (*DeviceConfig) SetAaudioNoAutoStartAfterReroute ¶
func (dc *DeviceConfig) SetAaudioNoAutoStartAfterReroute(disabled bool)
SetAaudioNoAutoStartAfterReroute sets whether auto start after reroute is disabled for AAudio.
func (*DeviceConfig) SetAaudioUsage ¶
func (dc *DeviceConfig) SetAaudioUsage(usage C.ma_aaudio_usage)
SetAaudioUsage sets the AAudio usage.
func (*DeviceConfig) SetAlsaNoAutoChannels ¶
func (dc *DeviceConfig) SetAlsaNoAutoChannels(disabled bool)
SetAlsaNoAutoChannels sets whether auto channels is disabled for ALSA.
func (*DeviceConfig) SetAlsaNoAutoFormat ¶
func (dc *DeviceConfig) SetAlsaNoAutoFormat(disabled bool)
SetAlsaNoAutoFormat sets whether auto format is disabled for ALSA.
func (*DeviceConfig) SetAlsaNoAutoResample ¶
func (dc *DeviceConfig) SetAlsaNoAutoResample(disabled bool)
SetAlsaNoAutoResample sets whether auto resample is disabled for ALSA.
func (*DeviceConfig) SetAlsaNoMMap ¶
func (dc *DeviceConfig) SetAlsaNoMMap(disabled bool)
SetAlsaNoMMap sets whether MMap is disabled for ALSA.
func (*DeviceConfig) SetCaptureCalculateLFEFromSpatialChannels ¶
func (dc *DeviceConfig) SetCaptureCalculateLFEFromSpatialChannels(enabled bool)
SetCaptureCalculateLFEFromSpatialChannels sets whether LFE calculation from spatial channels is enabled.
func (*DeviceConfig) SetCaptureChannelMixMode ¶
func (dc *DeviceConfig) SetCaptureChannelMixMode(mode ChannelMixMode)
SetCaptureChannelMixMode sets the capture channel mix mode.
func (*DeviceConfig) SetCaptureChannels ¶
func (dc *DeviceConfig) SetCaptureChannels(channels uint32)
SetCaptureChannels sets the capture channel count.
func (*DeviceConfig) SetCaptureDeviceID ¶
func (dc *DeviceConfig) SetCaptureDeviceID(id *DeviceID)
SetCaptureDeviceID sets the capture device ID.
func (*DeviceConfig) SetCaptureFormat ¶
func (dc *DeviceConfig) SetCaptureFormat(format Format)
SetCaptureFormat sets the capture format.
func (*DeviceConfig) SetCapturePChannelMap ¶
func (dc *DeviceConfig) SetCapturePChannelMap(channelMap unsafe.Pointer)
SetCapturePChannelMap sets the capture channel map pointer.
func (*DeviceConfig) SetCaptureShareMode ¶
func (dc *DeviceConfig) SetCaptureShareMode(mode C.ma_share_mode)
SetCaptureShareMode sets the capture share mode.
func (*DeviceConfig) SetCoreaudioAllowNominalSampleRateChange ¶
func (dc *DeviceConfig) SetCoreaudioAllowNominalSampleRateChange(allowed bool)
SetCoreaudioAllowNominalSampleRateChange sets whether nominal sample rate change is allowed for CoreAudio.
func (*DeviceConfig) SetDataCallback ¶
func (dc *DeviceConfig) SetDataCallback(callback C.ma_device_data_proc)
SetDataCallback sets the data callback.
func (*DeviceConfig) SetNoClip ¶
func (dc *DeviceConfig) SetNoClip(disabled bool)
SetNoClip sets whether clipping is disabled.
func (*DeviceConfig) SetNoDisableDenormals ¶
func (dc *DeviceConfig) SetNoDisableDenormals(disabled bool)
SetNoDisableDenormals sets whether denormal disabling is disabled.
func (*DeviceConfig) SetNoFixedSizedCallback ¶
func (dc *DeviceConfig) SetNoFixedSizedCallback(enabled bool)
SetNoFixedSizedCallback sets whether fixed-sized callback disabling is enabled.
func (*DeviceConfig) SetNoPreSilencedOutputBuffer ¶
func (dc *DeviceConfig) SetNoPreSilencedOutputBuffer(disabled bool)
SetNoPreSilencedOutputBuffer sets whether pre-silencing of output buffer is disabled.
func (*DeviceConfig) SetNotificationCallback ¶
func (dc *DeviceConfig) SetNotificationCallback(callback C.ma_device_notification_proc)
SetNotificationCallback sets the notification callback.
func (*DeviceConfig) SetOpenslEnableCompatibilityWorkarounds ¶
func (dc *DeviceConfig) SetOpenslEnableCompatibilityWorkarounds(enabled bool)
SetOpenslEnableCompatibilityWorkarounds sets whether compatibility workarounds are enabled for OpenSL.
func (*DeviceConfig) SetOpenslRecordingPreset ¶
func (dc *DeviceConfig) SetOpenslRecordingPreset(preset C.ma_opensl_recording_preset)
SetOpenslRecordingPreset sets the OpenSL recording preset.
func (*DeviceConfig) SetOpenslStreamType ¶
func (dc *DeviceConfig) SetOpenslStreamType(streamType C.ma_opensl_stream_type)
SetOpenslStreamType sets the OpenSL stream type.
func (*DeviceConfig) SetPUserData ¶
func (dc *DeviceConfig) SetPUserData(userData unsafe.Pointer)
SetPUserData sets the user data pointer.
func (*DeviceConfig) SetPerformanceProfile ¶
func (dc *DeviceConfig) SetPerformanceProfile(profile C.ma_performance_profile)
SetPerformanceProfile sets the performance profile.
func (*DeviceConfig) SetPeriodSizeInFrames ¶
func (dc *DeviceConfig) SetPeriodSizeInFrames(periodSize uint32)
SetPeriodSizeInFrames sets the period size in frames.
func (*DeviceConfig) SetPeriodSizeInMilliseconds ¶
func (dc *DeviceConfig) SetPeriodSizeInMilliseconds(periodSize uint32)
SetPeriodSizeInMilliseconds sets the period size in milliseconds.
func (*DeviceConfig) SetPeriods ¶
func (dc *DeviceConfig) SetPeriods(periods uint32)
SetPeriods sets the periods count.
func (*DeviceConfig) SetPlaybackCalculateLFEFromSpatialChannels ¶
func (dc *DeviceConfig) SetPlaybackCalculateLFEFromSpatialChannels(enabled bool)
SetPlaybackCalculateLFEFromSpatialChannels sets whether LFE calculation from spatial channels is enabled.
func (*DeviceConfig) SetPlaybackChannelMixMode ¶
func (dc *DeviceConfig) SetPlaybackChannelMixMode(mode ChannelMixMode)
SetPlaybackChannelMixMode sets the playback channel mix mode.
func (*DeviceConfig) SetPlaybackChannels ¶
func (dc *DeviceConfig) SetPlaybackChannels(channels uint32)
SetPlaybackChannels sets the playback channel count.
func (*DeviceConfig) SetPlaybackDeviceID ¶
func (dc *DeviceConfig) SetPlaybackDeviceID(id *DeviceID)
SetPlaybackDeviceID sets the playback device ID.
func (*DeviceConfig) SetPlaybackFormat ¶
func (dc *DeviceConfig) SetPlaybackFormat(format Format)
SetPlaybackFormat sets the playback format.
func (*DeviceConfig) SetPlaybackPChannelMap ¶
func (dc *DeviceConfig) SetPlaybackPChannelMap(channelMap unsafe.Pointer)
SetPlaybackPChannelMap sets the playback channel map pointer.
func (*DeviceConfig) SetPlaybackShareMode ¶
func (dc *DeviceConfig) SetPlaybackShareMode(mode C.ma_share_mode)
SetPlaybackShareMode sets the playback share mode.
func (*DeviceConfig) SetPulseChannelMap ¶
func (dc *DeviceConfig) SetPulseChannelMap(channelMap int32)
SetPulseChannelMap sets the PulseAudio channel map setting.
func (*DeviceConfig) SetPulseStreamNameCapture ¶
func (dc *DeviceConfig) SetPulseStreamNameCapture(name string)
SetPulseStreamNameCapture sets the PulseAudio capture stream name.
func (*DeviceConfig) SetPulseStreamNamePlayback ¶
func (dc *DeviceConfig) SetPulseStreamNamePlayback(name string)
SetPulseStreamNamePlayback sets the PulseAudio playback stream name.
func (*DeviceConfig) SetSampleRate ¶
func (dc *DeviceConfig) SetSampleRate(sampleRate uint32)
SetSampleRate sets the sample rate.
func (*DeviceConfig) SetStopCallback ¶
func (dc *DeviceConfig) SetStopCallback(callback C.ma_stop_proc)
SetStopCallback sets the stop callback.
func (*DeviceConfig) SetWasapiLoopbackProcessID ¶
func (dc *DeviceConfig) SetWasapiLoopbackProcessID(id uint32)
SetWasapiLoopbackProcessID sets the WASAPI loopback process ID.
func (*DeviceConfig) SetWasapiNoAutoConvertSRC ¶
func (dc *DeviceConfig) SetWasapiNoAutoConvertSRC(disabled bool)
SetWasapiNoAutoConvertSRC sets whether auto-convert SRC is disabled for WASAPI.
func (*DeviceConfig) SetWasapiNoDefaultQualitySRC ¶
func (dc *DeviceConfig) SetWasapiNoDefaultQualitySRC(disabled bool)
SetWasapiNoDefaultQualitySRC sets whether default quality SRC is disabled for WASAPI.
func (*DeviceConfig) SetWasapiNoHardwareOffloading ¶
func (dc *DeviceConfig) SetWasapiNoHardwareOffloading(disabled bool)
SetWasapiNoHardwareOffloading sets whether hardware offloading is disabled for WASAPI.
func (*DeviceConfig) StopCallback ¶
func (dc *DeviceConfig) StopCallback() C.ma_stop_proc
StopCallback returns the stop callback.
func (*DeviceConfig) WasapiLoopbackProcessID ¶
func (dc *DeviceConfig) WasapiLoopbackProcessID() uint32
WasapiLoopbackProcessID returns the WASAPI loopback process ID.
func (*DeviceConfig) WasapiNoAutoConvertSRC ¶
func (dc *DeviceConfig) WasapiNoAutoConvertSRC() bool
WasapiNoAutoConvertSRC returns whether auto-convert SRC is disabled for WASAPI.
func (*DeviceConfig) WasapiNoDefaultQualitySRC ¶
func (dc *DeviceConfig) WasapiNoDefaultQualitySRC() bool
WasapiNoDefaultQualitySRC returns whether default quality SRC is disabled for WASAPI.
func (*DeviceConfig) WasapiNoHardwareOffloading ¶
func (dc *DeviceConfig) WasapiNoHardwareOffloading() bool
WasapiNoHardwareOffloading returns whether hardware offloading is disabled for WASAPI.
type DeviceDirection ¶
type DeviceDirection int32
DeviceDirection represents ma_device_direction enum values.
const ( DeviceDirectionPlayback DeviceDirection = 1 << 0 DeviceDirectionCapture DeviceDirection = 1 << 1 )
type DeviceType ¶
type DeviceType int32
DeviceType represents ma_device_type enum values.
const ( DeviceTypePlayback DeviceType = 1 << 0 DeviceTypeCapture DeviceType = 1 << 1 DeviceTypeDuplex DeviceType = 1 << 2 DeviceTypeLoopback DeviceType = 1 << 3 )
type DitherMode ¶
type DitherMode int32
DitherMode represents ma_dither_mode enum values.
const ( DitherModeNone DitherMode = 0 DitherModeRectangular DitherMode = 1 )
type EncodingFormat ¶
type EncodingFormat int32
EncodingFormat represents ma_encoding_format enum values.
const ( EncodingFormatUnknown EncodingFormat = 0 EncodingFormatWav EncodingFormat = 1 EncodingFormatAiff EncodingFormat = 2 )
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine is a high-level audio engine that wraps around the resource manager and node graph.
func NewEngine ¶
func NewEngine(config *EngineConfig) (*Engine, error)
NewEngine creates a new Engine instance, initializes it with ma_engine_init, and returns it.
func (*Engine) FindClosestListener ¶
FindClosestListener finds the closest listener to the given position.
func (*Engine) ListenerCone ¶
ListenerCone returns the cone of the listener.
func (*Engine) ListenerCount ¶
ListenerCount returns the number of listeners.
func (*Engine) ListenerDirection ¶
ListenerDirection returns the direction of the listener.
func (*Engine) ListenerIsEnabled ¶
ListenerIsEnabled returns whether the listener is enabled.
func (*Engine) ListenerPosition ¶
ListenerPosition returns the position of the listener.
func (*Engine) ListenerSetCone ¶
func (e *Engine) ListenerSetCone(listenerIndex uint32, innerAngle, outerAngle, outerGain float32) error
ListenerSetCone sets the cone of the listener.
func (*Engine) ListenerSetDirection ¶
ListenerSetDirection sets the direction of the listener.
func (*Engine) ListenerSetEnabled ¶
ListenerSetEnabled enables or disables the listener.
func (*Engine) ListenerSetPosition ¶
ListenerSetPosition sets the position of the listener.
func (*Engine) ListenerSetVelocity ¶
ListenerSetVelocity sets the velocity of the listener (for Doppler effect).
func (*Engine) ListenerSetWorldUp ¶
ListenerSetWorldUp sets the world up vector of the listener.
func (*Engine) ListenerVelocity ¶
ListenerVelocity returns the velocity of the listener.
func (*Engine) NodeGraph ¶
func (e *Engine) NodeGraph() *C.ma_node_graph
NodeGraph returns the underlying node graph.
func (*Engine) PlaySoundEx ¶
PlaySoundEx plays a sound with the given file path, parent node, and input bus index.
func (*Engine) PlaySoundFromDataSource ¶
func (e *Engine) PlaySoundFromDataSource(dataSource DataSource, flags SoundFlags, group *Sound) (*Sound, error)
PlaySoundFromDataSource creates and starts a sound from a data source.
func (*Engine) PlaySoundFromFile ¶
func (e *Engine) PlaySoundFromFile(filePath string, flags SoundFlags, group *Sound, doneFence unsafe.Pointer) (*Sound, error)
PlaySoundFromFile creates and starts a sound from a file path.
func (*Engine) ReadPCMFrames ¶
func (e *Engine) ReadPCMFrames(frameCount uint64, pFramesOut []float32) (framesRead uint64, err error)
ReadPCMFrames reads PCM frames from the engine.
func (*Engine) ResourceManager ¶
func (e *Engine) ResourceManager() *C.ma_resource_manager
ResourceManager returns the underlying resource manager.
func (*Engine) SampleRate ¶
SampleRate returns the sample rate of the engine.
func (*Engine) SetTimeInMilliseconds ¶
SetTimeInMilliseconds sets the current global time in milliseconds.
func (*Engine) SetTimeInPCMFrames ¶
SetTimeInPCMFrames sets the current global time in PCM frames.
func (*Engine) TimeInMilliseconds ¶
TimeInMilliseconds returns the current global time in milliseconds.
func (*Engine) TimeInPCMFrames ¶
TimeInPCMFrames returns the current global time in PCM frames.
type EngineConfig ¶
type EngineConfig struct {
// contains filtered or unexported fields
}
EngineConfig wraps ma_engine_config.
func NewEngineConfig ¶
func NewEngineConfig() *EngineConfig
NewEngineConfig creates a new EngineConfig and calls ma_engine_config_init.
func (*EngineConfig) Channels ¶
func (ec *EngineConfig) Channels() uint32
Channels returns the channel count.
func (*EngineConfig) Close ¶
func (ec *EngineConfig) Close()
func (*EngineConfig) DataCallback ¶
func (ec *EngineConfig) DataCallback() C.ma_device_data_proc
DataCallback returns the data callback.
func (*EngineConfig) DefaultVolumeSmoothTimeInPCMFrames ¶
func (ec *EngineConfig) DefaultVolumeSmoothTimeInPCMFrames() uint32
DefaultVolumeSmoothTimeInPCMFrames returns the default volume smooth time in PCM frames.
func (*EngineConfig) GainSmoothTimeInFrames ¶
func (ec *EngineConfig) GainSmoothTimeInFrames() uint32
GainSmoothTimeInFrames returns the gain smooth time in frames.
func (*EngineConfig) GainSmoothTimeInMilliseconds ¶
func (ec *EngineConfig) GainSmoothTimeInMilliseconds() uint32
GainSmoothTimeInMilliseconds returns the gain smooth time in milliseconds.
func (*EngineConfig) ListenerCount ¶
func (ec *EngineConfig) ListenerCount() uint32
ListenerCount returns the listener count.
func (*EngineConfig) MonoExpansionMode ¶
func (ec *EngineConfig) MonoExpansionMode() uint32
MonoExpansionMode returns the mono expansion mode.
func (*EngineConfig) NoAutoStart ¶
func (ec *EngineConfig) NoAutoStart() bool
NoAutoStart returns whether auto start is disabled.
func (*EngineConfig) NoDevice ¶
func (ec *EngineConfig) NoDevice() bool
NoDevice returns whether device creation is disabled.
func (*EngineConfig) NotificationCallback ¶
func (ec *EngineConfig) NotificationCallback() C.ma_device_notification_proc
NotificationCallback returns the notification callback.
func (*EngineConfig) OnProcess ¶
func (ec *EngineConfig) OnProcess() C.ma_engine_process_proc
OnProcess returns the on process callback.
func (*EngineConfig) PContext ¶
func (ec *EngineConfig) PContext() *Context
PContext returns the context pointer.
func (*EngineConfig) PDevice ¶
func (ec *EngineConfig) PDevice() *Device
PDevice returns the device pointer.
func (*EngineConfig) PProcessUserData ¶
func (ec *EngineConfig) PProcessUserData() unsafe.Pointer
PProcessUserData returns the user data for onProcess.
func (*EngineConfig) PaymentDeviceID ¶
func (ec *EngineConfig) PaymentDeviceID() *DeviceID
PaymentDeviceID returns the playback device ID pointer.
func (*EngineConfig) PeriodSizeInFrames ¶
func (ec *EngineConfig) PeriodSizeInFrames() uint32
PeriodSizeInFrames returns the period size in frames.
func (*EngineConfig) PeriodSizeInMilliseconds ¶
func (ec *EngineConfig) PeriodSizeInMilliseconds() uint32
PeriodSizeInMilliseconds returns the period size in milliseconds.
func (*EngineConfig) PreMixStackSizeInBytes ¶
func (ec *EngineConfig) PreMixStackSizeInBytes() uint32
PreMixStackSizeInBytes returns the pre-mix stack size in bytes.
func (*EngineConfig) SampleRate ¶
func (ec *EngineConfig) SampleRate() uint32
SampleRate returns the sample rate.
func (*EngineConfig) SetChannels ¶
func (ec *EngineConfig) SetChannels(channels uint32)
SetChannels sets the channel count.
func (*EngineConfig) SetDataCallback ¶
func (ec *EngineConfig) SetDataCallback(callback C.ma_device_data_proc)
SetDataCallback sets the data callback.
func (*EngineConfig) SetDefaultVolumeSmoothTimeInPCMFrames ¶
func (ec *EngineConfig) SetDefaultVolumeSmoothTimeInPCMFrames(frames uint32)
SetDefaultVolumeSmoothTimeInPCMFrames sets the default volume smooth time in PCM frames.
func (*EngineConfig) SetGainSmoothTimeInFrames ¶
func (ec *EngineConfig) SetGainSmoothTimeInFrames(frames uint32)
SetGainSmoothTimeInFrames sets the gain smooth time in frames.
func (*EngineConfig) SetGainSmoothTimeInMilliseconds ¶
func (ec *EngineConfig) SetGainSmoothTimeInMilliseconds(milliseconds uint32)
SetGainSmoothTimeInMilliseconds sets the gain smooth time in milliseconds.
func (*EngineConfig) SetListenerCount ¶
func (ec *EngineConfig) SetListenerCount(count uint32)
SetListenerCount sets the listener count.
func (*EngineConfig) SetMonoExpansionMode ¶
func (ec *EngineConfig) SetMonoExpansionMode(mode uint32)
SetMonoExpansionMode sets the mono expansion mode.
func (*EngineConfig) SetNoAutoStart ¶
func (ec *EngineConfig) SetNoAutoStart(noAutoStart bool)
SetNoAutoStart sets whether auto start is disabled.
func (*EngineConfig) SetNoDevice ¶
func (ec *EngineConfig) SetNoDevice(noDevice bool)
SetNoDevice sets whether device creation is disabled.
func (*EngineConfig) SetNotificationCallback ¶
func (ec *EngineConfig) SetNotificationCallback(callback C.ma_device_notification_proc)
SetNotificationCallback sets the notification callback.
func (*EngineConfig) SetOnProcess ¶
func (ec *EngineConfig) SetOnProcess(callback C.ma_engine_process_proc)
SetOnProcess sets the on process callback.
func (*EngineConfig) SetPContext ¶
func (ec *EngineConfig) SetPContext(ctx *Context)
SetPContext sets the context pointer.
func (*EngineConfig) SetPDevice ¶
func (ec *EngineConfig) SetPDevice(device *Device)
SetPDevice sets the device pointer.
func (*EngineConfig) SetPLog ¶
func (ec *EngineConfig) SetPLog(log *Log)
SetPLog sets the log pointer.
func (*EngineConfig) SetPPaymentDeviceID ¶
func (ec *EngineConfig) SetPPaymentDeviceID(deviceID *DeviceID)
SetPPaymentDeviceID sets the playback device ID pointer.
func (*EngineConfig) SetPProcessUserData ¶
func (ec *EngineConfig) SetPProcessUserData(userData unsafe.Pointer)
SetPProcessUserData sets the user data for onProcess.
func (*EngineConfig) SetPeriodSizeInFrames ¶
func (ec *EngineConfig) SetPeriodSizeInFrames(periodSize uint32)
SetPeriodSizeInFrames sets the period size in frames.
func (*EngineConfig) SetPeriodSizeInMilliseconds ¶
func (ec *EngineConfig) SetPeriodSizeInMilliseconds(periodSize uint32)
SetPeriodSizeInMilliseconds sets the period size in milliseconds.
func (*EngineConfig) SetPreMixStackSizeInBytes ¶
func (ec *EngineConfig) SetPreMixStackSizeInBytes(size uint32)
SetPreMixStackSizeInBytes sets the pre-mix stack size in bytes.
func (*EngineConfig) SetSampleRate ¶
func (ec *EngineConfig) SetSampleRate(sampleRate uint32)
SetSampleRate sets the sample rate.
type EngineError ¶
type EngineError struct {
// contains filtered or unexported fields
}
EngineError is an error type for engine operations.
func (*EngineError) Error ¶
func (e *EngineError) Error() string
type NodeGraph ¶
type NodeGraph struct {
// contains filtered or unexported fields
}
NodeGraph wraps ma_node_graph.
func NewNodeGraph ¶
func NewNodeGraph(config *NodeGraphConfig) (*NodeGraph, error)
NewNodeGraph creates a new NodeGraph instance, initializes it with ma_node_graph_init, and returns it.
func (*NodeGraph) Close ¶
func (ng *NodeGraph) Close()
Close uninitializes and releases the node graph memory.
func (*NodeGraph) ProcessingSizeInFrames ¶
ProcessingSizeInFrames returns the processing size in frames of the node graph.
func (*NodeGraph) ReadPCMFrames ¶
ReadPCMFrames reads PCM frames from the node graph.
type NodeGraphConfig ¶
type NodeGraphConfig struct {
// contains filtered or unexported fields
}
NodeGraphConfig wraps ma_node_graph_config.
func NewNodeGraphConfig ¶
func NewNodeGraphConfig(channels uint32) *NodeGraphConfig
NewNodeGraphConfig creates a new NodeGraphConfig and calls ma_node_graph_config_init.
func (*NodeGraphConfig) Close ¶
func (ngc *NodeGraphConfig) Close()
type ResamplerQuality ¶
type ResamplerQuality int32
ResamplerQuality represents ma_resampler_quality enum values.
const ( ResamplerQualityLow ResamplerQuality = 0 ResamplerQualityMedium ResamplerQuality = 1 ResamplerQualityHigh ResamplerQuality = 2 ResamplerQualityHighFC ResamplerQuality = 3 )
type ReverveNode ¶
type ReverveNode struct {
// contains filtered or unexported fields
}
func NewReverveNode ¶
func NewReverveNode(nodeGraph *NodeGraph, config *ReverveNodeConfig, callbacks *AllocationCallbacks) *ReverveNode
func (*ReverveNode) Close ¶
func (n *ReverveNode) Close()
func (*ReverveNode) Damping ¶
func (n *ReverveNode) Damping() float32
Damping はダンピング量を返します。範囲: 0.0 〜 1.0
func (*ReverveNode) DryVolume ¶
func (n *ReverveNode) DryVolume() float32
DryVolume はドライ信号の音量を返します。範囲: 0.0 〜 1.0
func (*ReverveNode) Mode ¶
func (n *ReverveNode) Mode() float32
Mode はリバーブのモードを返します。0.5 未満は通常、それ以上はフリーズ(凍結)モード
func (*ReverveNode) RoomSize ¶
func (n *ReverveNode) RoomSize() float32
RoomSize は部屋のサイズを返します。範囲: 0.0 〜 1.0
func (*ReverveNode) SetDamping ¶
func (n *ReverveNode) SetDamping(damping float32)
SetDamping はダンピング量を設定します。範囲: 0.0 〜 1.0
func (*ReverveNode) SetDryVolume ¶
func (n *ReverveNode) SetDryVolume(dryVolume float32)
SetDryVolume はドライ信号の音量を設定します。範囲: 0.0 〜 1.0
func (*ReverveNode) SetMode ¶
func (n *ReverveNode) SetMode(mode float32)
SetMode はリバーブのモードを設定します。0.5 未満は通常、それ以上はフリーズ(凍結)モード
func (*ReverveNode) SetRoomSize ¶
func (n *ReverveNode) SetRoomSize(roomSize float32)
SetRoomSize は部屋のサイズを設定します。範囲: 0.0 〜 1.0
func (*ReverveNode) SetWetVolume ¶
func (n *ReverveNode) SetWetVolume(wetVolume float32)
SetWetVolume はウェット信号の音量を設定します。範囲: 0.0 〜 1.0
func (*ReverveNode) SetWidth ¶
func (n *ReverveNode) SetWidth(width float32)
SetWidth はステレオ幅を設定します。範囲: 0.0 〜 1.0
func (*ReverveNode) WetVolume ¶
func (n *ReverveNode) WetVolume() float32
WetVolume はウェット信号の音量を返します。範囲: 0.0 〜 1.0
type ReverveNodeConfig ¶
type ReverveNodeConfig struct {
// contains filtered or unexported fields
}
func NewReverveNodeConfig ¶
func NewReverveNodeConfig(channels, sampleRate uint32) *ReverveNodeConfig
func (*ReverveNodeConfig) Damping ¶
func (c *ReverveNodeConfig) Damping() float32
Damping はダンピング量を返します。範囲: 0.0 〜 1.0
func (*ReverveNodeConfig) DryVolume ¶
func (c *ReverveNodeConfig) DryVolume() float32
DryVolume はドライ信号の音量を返します。範囲: 0.0 〜 1.0
func (*ReverveNodeConfig) Free ¶
func (c *ReverveNodeConfig) Free()
func (*ReverveNodeConfig) Mode ¶
func (c *ReverveNodeConfig) Mode() float32
Mode はリバーブのモードを返します。0.5 未満は通常、それ以上はフリーズ(凍結)モード
func (*ReverveNodeConfig) RoomSize ¶
func (c *ReverveNodeConfig) RoomSize() float32
RoomSize は部屋のサイズを返します。範囲: 0.0 〜 1.0
func (*ReverveNodeConfig) SetDamping ¶
func (c *ReverveNodeConfig) SetDamping(damping float32)
SetDamping はダンピング量を設定します。範囲: 0.0 〜 1.0
func (*ReverveNodeConfig) SetDryVolume ¶
func (c *ReverveNodeConfig) SetDryVolume(dryVolume float32)
SetDryVolume はドライ信号の音量を設定します。範囲: 0.0 〜 1.0
func (*ReverveNodeConfig) SetMode ¶
func (c *ReverveNodeConfig) SetMode(mode float32)
SetMode はリバーブのモードを設定します。0.5 未満は通常、それ以上はフリーズ(凍結)モード
func (*ReverveNodeConfig) SetRoomSize ¶
func (c *ReverveNodeConfig) SetRoomSize(roomSize float32)
SetRoomSize は部屋のサイズを設定します。範囲: 0.0 〜 1.0
func (*ReverveNodeConfig) SetWetVolume ¶
func (c *ReverveNodeConfig) SetWetVolume(wetVolume float32)
SetWetVolume はウェット信号の音量を設定します。範囲: 0.0 〜 1.0
func (*ReverveNodeConfig) SetWidth ¶
func (c *ReverveNodeConfig) SetWidth(width float32)
SetWidth はステレオ幅を設定します。範囲: 0.0 〜 1.0
func (*ReverveNodeConfig) WetVolume ¶
func (c *ReverveNodeConfig) WetVolume() float32
WetVolume はウェット信号の音量を返します。範囲: 0.0 〜 1.0
func (*ReverveNodeConfig) Width ¶
func (c *ReverveNodeConfig) Width() float32
Width はステレオ幅を返します。範囲: 0.0 〜 1.0
type SeekOrigin ¶
type SeekOrigin int32
SeekOrigin represents ma_seek_origin enum values.
const ( SeekOriginBegin SeekOrigin = 0 SeekOriginCurrent SeekOrigin = 1 SeekOriginEnd SeekOrigin = 2 )
type Sound ¶
type Sound struct {
// contains filtered or unexported fields
}
Sound wraps ma_sound.
func NewSound ¶
func NewSound(engine *Engine, config *SoundConfig) (*Sound, error)
NewSound creates a new Sound instance and initializes it with ma_sound_init_ex.
func (*Sound) DataSource ¶
DataSource returns the data source of this sound.
func (*Sound) IsSpatializationEnabled ¶
IsSpatializationEnabled returns whether the sound spatialization is enabled.
func (*Sound) ResetStartTime ¶
func (s *Sound) ResetStartTime()
ResetStartTime resets the sound start time.
func (*Sound) ResetStopTime ¶
func (s *Sound) ResetStopTime()
ResetStopTime resets the sound stop time.
func (*Sound) SetPosition ¶
SetPosition sets the sound position.
func (*Sound) SetSpatializationEnabled ¶
SetSpatializationEnabled sets the sound spatialization enabled.
type SoundConfig ¶
type SoundConfig struct {
// contains filtered or unexported fields
}
SoundConfig wraps ma_sound_config.
func NewSoundConfig ¶
func NewSoundConfig(engine *Engine) *SoundConfig
NewSoundConfig creates a new SoundConfig and calls ma_sound_config_init_2.
func (*SoundConfig) Close ¶
func (sc *SoundConfig) Close()
type SoundFlags ¶
type SoundFlags uint32
const ( SoundFlagStream SoundFlags = 0x00000001 SoundFlagDecode SoundFlags = 0x00000002 SoundFlagAsync SoundFlags = 0x00000004 SoundFlagWaitInit SoundFlags = 0x00000008 SoundFlagUnknownLength SoundFlags = 0x00000010 SoundFlagLooping SoundFlags = 0x00000020 SoundFlagNoDefaultAttachment SoundFlags = 0x00001000 SoundFlagNoPitch SoundFlags = 0x00002000 SoundFlagNoSpatialization SoundFlags = 0x00004000 )