Is there a way, if using the IrrKlangaudio, of accessing the other exposed features of IrrKlang ?
i.e. StopAllSounds(), RemoveSoundSourceSource() etc ?
i.e. StopAllSounds(), RemoveSoundSourceSource() etc ?
Local sound:TSound = LoadSound(....) Local mySoundSource:TSoundSoure = TISoundSourceSound(sound)._sound Print mySoundSource.GetPlayLength()
Local channel:TChannel = CueSound(sound) Local myISound:TISound = TTISoundChannel(channel)._channel myISound.SetPan(0.5) Local sfx:TISoundEffectControl = myISound.GetSoundEffectControl() sfx.EnableEchoSoundEffect()
_engine.AddSoundSourceFromMemory(IncbinPtr("media/getout.ogg"), IncbinLen("media/getout.ogg"), "aa") ' play the sound we added to memory Global snd:TISound = _engine.Play2D("aa") snd.setMinDistance(5.0) ' <<<<< error NULL
Method Play2D:TISound(soundfileName:String, playLooped:Int = False, startPaused:Int = False, .. track:Int = False, streamMode:Int = ESM_AUTO_DETECT, enableSoundEffects:Int = False) Local s:Byte Ptr = soundfileName.ToCString() Local sound:Byte Ptr = bmx_soundengine_play2d(refPtr, s, playLooped, startPaused, track, streamMode, enableSoundEffects) ' ' Seems "sound" is not being set here ' MemFree(s) Return TISound._create(sound) End Method .... . . Type TISound Field soundPtr:Byte Ptr Function _create:TISound(soundPtr:Byte Ptr) If soundPtr Then '<<<< this is always NULL Local this:TISound = New TISound this.soundPtr = soundPtr Return this End If End Function
Local snd:TISoundSource = _engine.AddSoundSourceFromFile("media/getout.ogg", 0, True) Local Channel:tisound = _engine.Play2DSource(snd,True,True) channel.setpaused(False)
SuperStrict Framework BaH.irrKlang Import BRL.StandardIO Import BRL.GLMax2D ' start the sound engine with default parameters Local _engine:TISoundEngine = CreateIrrKlangDevice() If Not _engine Then Print "Could not startup engine" End End If Graphics 640,480,0 Local snd:TISoundSource = _engine.AddSoundSourceFromFile("media/getout.ogg", 0, True) Local Channel:tisound[20] While Not KeyDown(KEY_Q) Cls DrawText "Press 1 to load/unload channels - q to quit.", 50, 20 Flip Local key:Int = WaitKey() If key = key_1 Then For Local t:Int = 0 To 19 channel[t] = _engine.Play2DSource(snd,True,True) Next DebugLog("ALL ASSIGNED") For Local t:Int = 0 To 19 channel[t].stop() channel[t].drop() channel[t] = Null Next DebugLog("ALL UN-ASSIGNED") EndIf Wend _engine.RemoveSoundSourceSource(snd) _engine.RemoveAllSoundSources() _engine.Drop() End