Using Audiere I started to create an audio plugin for DarkBASIC Professional that plays Ogg Vorbis, MP3, FLAC, uncompressed WAV, AIFF, MOD, S3M, XM, and IT files.
There are still a few commands that I need to add but the majority of them are in place and ready for testing. Here is the current command list:
-Command list updated on September 8th-
LOAD AUDIO audio index number, filename
DELETE AUDIO audio index number
PLAY AUDIO audio index number
STOP AUDIO audio index number
LOOP AUDIO audio index number
AUDIO VOLUME audio index number, volume (float)
*NOTE: volume 0.0 = silence, 1.0 = maximum volume (default)
AUDIO PAN audio index number, pan (float)
*NOTE: pan -1.0 = left, 0.0 = center (default), 1.0 = right
AUDIO PITCH SHIFT audio index number, pitch shift (float)
*NOTE: pitch shift range 0.5 to 2.0
GET AUDIO VOLUME audio index number (returns float)
GET AUDIO PAN audio index number (returns float)
GET AUDIO PITCH SHIFT audio index number (returns float)
AUDIO PLAYING audio index number (returns true or false)
AUDIO SEEKABLE audio index number (returns true or false)
AUDIO LENGTH audio index number (returns number of frames in the streaming sound or returns 0 for not seekable)
AUDIO POSITION audio index number (returns current position in frames)
AUDIO SET POSITION audio index number, position
AUDIO USE DEVICE device (1 = winmm, 2 = DirectSound)
SET AUDIO TRIGGER ZONE trigger index, audio index, trigger x, trigger y, trigger z, height, width, depth, trigger type
*NOTE: Trigger Types,
1 = Play sound when trigger entered, stops when trigger exited.
2 = Play sound when trigger entered, keeps playing till done even if the trigger area is exited.
3 = Plays sound only once.
4 = Loops sound when trigger entered, stops sound when trigger exited.
CHECK AUDIO TRIGGER ZONE trigger index, current x position, current y position, current z position
AUDIO WHITE NOISE audio index number
AUDIO PINK NOISE audio index number
AUDIO RESET PLAYED trigger index number
There are 2 files included in the zip file, here's instructions for each file:
audiodll.ini - Add this file to your keywords folder.
audiodll.dll - Add this file to your plugins-user folder.
Thanks for helping me test this plugin!
-Updated on September 16th-
Click here to download the plugin.
EXTRA NOTE: When using this plugin remember to use DELETE AUDIO for each index that you create. The audiere uses a strange method of keeping track of the audio and could cause your program to stay in memory if the indexes are not removed. Also there is a index limit (but error handling to check for the limit has not been set yet), the current limit of indexes is 1000. `