PDA

View Full Version : Are MP3's Possible in DelphiX?



Cer3brus
07-04-2009, 05:45 PM
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?

chronozphere
07-04-2009, 09:22 PM
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 (http://www.mpg123.de/) 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 (http://www.xiph.org/downloads/) and the corresponding headers (http://www.pasports.org/pp2007-jedi.htm)

Hope this was helpfull. :)

Wizard
08-04-2009, 06:27 AM
Yes, I also use MediaPlayer for playing mp3's with unDelphiX :P DelphiX/unDelphix doesn't support mp3's :no:

NecroDOME
08-04-2009, 10:09 AM
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...

harrypitfall
10-05-2009, 06:47 AM
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...

Brainer
10-05-2009, 07:51 AM
How about this?
http://download.4programmers.net/download.php?id=408

harrypitfall
13-07-2009, 02:59 AM
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... :S

http://rapidshare.com/files/255184116/UnDelphiXExtra.zip