Iv'e been learning to use DelphiX and although it has excellent support for wavs, it doesn't seem to support MP3's. Is it possible? If so, how?
Iv'e been learning to use DelphiX and although it has excellent support for wavs, it doesn't seem to support MP3's. Is it possible? If so, how?
No.. As far as I know, delphiX can only play wav (maybe also aiff or something simiair). The sound components in DirectX are primarily used to play sound-effects and not music. I think it is better to seek a seperate sollution for music playback.
The simplest sollution would be to drop a MediaPlayer on your form and play it with that. It's easy, doesn't require a lot of code, and it supports a few nice formats. If you want to do it all by yourself, it would require you to decode your MP3 file and that is quite tedious. If you want to go this way, this will become handy. Just google for some pascal headers and you should be able to use it.
Slightly easier (if you want to do it yourself), is to pick the Ogg vorbis format and implement that. Check this and the corresponding headers
Hope this was helpfull.
Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.
Yes, I also use MediaPlayer for playing mp3's with unDelphiX DelphiX/unDelphix doesn't support mp3's
Wake up from the dream and live your life to the full
I remember my first game that I made with Delphi. It had 8 media players (channels) and some code to manage which player should open and play the sound. It worked but was inefficient.
I can dig up my old UnDelphiX project and see if I used a media player or just UnDelphiX for player mp3's...
NecroSOFT - End of line -
I have a extra component based on DirectShow that play mp3 files. (Also, can play midi files direct from a collection, the midi file itself is embebbed).
Current, it can only play external mp3 files, I can't select a "stream" as source, only files... :/
Also, I have a "StateEngine" component, event based, that helps my development of games, and a extra unit with some Sprite derived classes (with events, mouse helper, hud text sprite...)
Since you have the source, isn't hard to create new components to help and merge in delphix...
How about this?
http://download.4programmers.net/download.php?id=408
This is my "UnDelphiX Extra" components pack, my version of Music component (I did it before michel does the version on last UnDelphiX release) can play midi from stream, and, can play mp3 files (stop then, replay then, and have a event trigger when the mp3 file ends - so you can just call DXMusic1.ReplayMP3; to loop).
Also, there is my version of sprite engine, with extra slots for information, support to events and a pixel check collision procedure (that is slower and less buggy than original). By default, pixel check and the "SagWare" check collision is disabled.
And, a component to control game states, very usefull if you understand... I use it to control my games (like my wolfenstein), I create this component inspired by klik'n'play...
http://rapidshare.com/files/25518411...lphiXExtra.zip
Bookmarks