irrKlang question

BlitzMax Modules Forums/Brucey's Modules/irrKlang question

Brucey:

Why doesn't this work...

SuperStrict

Framework BaH.irrKlangAudio
Import BRL.StandardIO

Local drivers:String[] = AudioDrivers()

Print "Audio Drivers : "
For Local d:Int = 0 Until drivers.length
    Print drivers[d]
Next

SetAudioDriver("irrKlang")

Local sound:TSound = LoadSound("../../irrklang.mod/examples/media/getout.ogg", SOUND_LOOP)
Local channel:TChannel = AllocChannel()
CueSound(sound, channel)
ResumeChannel(channel)

Local i:Int

While i < 300

    Delay(100)
    i:+ 1
Wend


It crashes on the ResumeChannel command.

Also, I am getting an error message when I use your mod...
Warning: The library version of irrKlang (1.1.3) does not match the version the application was compiled with (1.0.4). This may cause problems.

It crashes on the ResumeChannel command.

That would be a bug... Fixed in SVN.

I am getting an error message...

If you are building with the latest "release", it includes 1.0.4 of irrKlang. In SVN it is using 1.1.3 (which I think is the latest).
It's just a warning to say that it's possible there may have been API changes between version which may, or may not cause issues. As far as I know, the API hasn't changed - only the internal code.

I suppose I should look at building a new release... ;-)

Thanks Brucey.

One more issue:

SuperStrict

Framework BaH.irrKlangAudio
Import BRL.StandardIO

Local drivers:String[] = AudioDrivers()

Print "Audio Drivers : "
For Local d:Int = 0 Until drivers.length
    Print drivers[d]
Next

SetAudioDriver("irrKlang")

Local sound:TSound = LoadSound("../../irrklang.mod/examples/media/getout.ogg", SOUND_LOOP)
Local channel:TChannel = AllocChannel()

SetChannelVolume(channel, 0.5)

CueSound(sound, channel)
ResumeChannel(channel)

Local i:Int

While i < 300

    Delay(100)
    i:+ 1
Wend


Same code as before, but notice the SetChannelVolume command. This will crash the program will a null reference to the channel. SetChannelRate kills it too. But it'll work if you move it below the CueSound command.

BlitzMax's default sound driver will allow you to set a channel's volume and rate before you Cue it. I am wondering if this is something that can be addressed or not? I'll have to do a lot of changes to my code if I am required to move the SetChannelVolume snd SetChannelRate commands around.

Just volume and rate commands? Or are there potentially others too?

SetChannelPan kills it too. Also if you check ChannelPlaying(channel), it dies with null as well.

I haven't checked all the commands, but it appears many Channel commands die if the channel isn't Cued before you use the command.

Okay. I've changed it so that the settings are now cached internally, so that when the channel is actually Cued, it will set everything then. The underlying channel doesn't exist until you cue or play it. (not that you care... so long as it works! ;-)

Okay! Cool, I have irrKlang as an audio driver working under Vista. Now to try XP, then Mac, and finally Linux. So far it seems really nice- it loads music about 500% faster than the default audio driver (is it streaming?). Also no pops, clicks, or muffled audio.

Anyway, I also hope to utilize some of irrKlang's audio FX (Reverb, Flange, etc.). Hopefully this is possible! Could irrKlang be the more stable and functional BlitzMax audio driver I have been needing for three years?! =D

Ohh, Brucey....severe Panning issues with irrKlang.

Import  BaH.irrKlangAudio

Graphics 640, 480

SetAudioDriver("irrKlang")

channel = AllocChannel ()
sound = LoadSound ("C:\Program Files\BlitzMax\samples\digesteroids\sounds\fire.wav") ' Use a short sample...

Repeat
	If MouseHit(1) PlaySound sound,channel
	
	pan# = MouseX () / (GraphicsWidth () / 2.0) - 1
	vol# = 1 - MouseY () / 480.0
	SetChannelPan channel, pan
	SetChannelVolume channel, vol*2

	Cls
	DrawText "Click to play...", 240, 200
	DrawText "Pan   : " + pan, 240, 220
	DrawText "Volume: " + vol, 240, 240

	Flip
Until KeyHit (KEY_ESCAPE)

End

Using Vista + Sound Blaster X-Fi (all system drivers up-tp-date)

This is the same code I posted up in the Bug forum regarding panning: http://www.blitzbasic.com/Community/posts.php?topic=80266

What I hear with irrKlang is almost worst- not sure how to explain it, but it sounds like panning is just possibly reversed, and I get little "blip" sounds when it is far to the left or right.

I've been trying to perform a panning test with the irrKlang "helloworld.bmx" example to see if panning works OK when making direct irrKlang calls, but since my brain is so hard-wired into the way BlitzMax handles sound I am having difficulties making this happen. :P

Could you mail me a release build of this please, and I'll see if the irrKlang developer can help/has any ideas.
SuperStrict
Framework BaH.irrKlangAudio
Import brl.glmax2d
?win32
Import brl.d3d7max2d
? 

Graphics 640, 480,0

SetAudioDriver("irrKlang")

Local channel:TChannel = AllocChannel ()
Local sound:TSound = LoadSound ("fire.wav") ' Use a short sample...

Repeat
	If MouseHit(1) PlaySound sound,channel
	
	Local pan# = 1 - MouseX () / (GraphicsWidth () / 2.0)
	Local vol# = 1 - MouseY () / 480.0

	SetChannelPan channel, pan
	SetChannelVolume channel, vol*2

	Cls
	DrawText "Click to play...", 240, 200
	DrawText "Pan   : " + pan, 240, 220
	DrawText "Volume: " + vol, 240, 240

	Flip
Until KeyHit (KEY_ESCAPE)

End

(note local dir for file).

In fact, if you can zip up the 3 files (exe + dll + wav), then we'll have everything you're using.

Thanks.

it sounds like panning is just possibly reversed

It's strange that. It almost seems like it 1 is left and -1 is right... which is easily fixed, I guess (by me reversing the value).