[EO] Adding Mp3 support to EO - VERY BASIC

Here we go, this will add very basic mp3 support to Eo.

its so basic, it only works for map music, and its not utalizing any of the buildin sound systems … yet I hope xd

anyway, lets start shall we ^^

First download the 2 attachments, and put them in the src folder of the client, overwrite the one allready there.

Then add the files to the project, by clicking in project browser on the right side, and choose add> existing file, and add modDxShow.

now go to Project>references and add a ref to active movie control type library.

Now in modGeneral, in Public sub PopulateLists, look for :

' music in map properties
    frmEditor_MapProperties.lstMusic.Clear
    frmEditor_MapProperties.lstMusic.AddItem "None."
    strLoad = Dir(App.Path & MUSIC_PATH & "*.mid")
    Do While strLoad > vbNullString
       frmEditor_MapProperties.lstMusic.AddItem strLoad
       strLoad = Dir
    Loop

after that, add :

Fix by Anthony:

    strLoad = Dir(App.Path & MUSIC_PATH & "*.mp3")
    Do While strLoad > vbNullString
        ReDim Preserve musicCache(1 To i) As String
        musicCache(i) = strLoad
        strLoad = Dir
        i = i + 1
    Loop

this will make sure the mp3 files are found so they show up in mapeditor.

then, in modGameLogic, look for :

' Calculate fps
        If TickFPS < Tick Then
            GameFPS = FPS
            TickFPS = Tick + 1000
            FPS = 0
        Else
            FPS = FPS + 1
        End If

after that, add :

'loop mapmusic if needed and its a mp3 file
 LoopMp3

That should be it, if I didnt forget anything xd

let me know what ya think, and if it worked for ya.

Note to robin, if ya have pointers to include it in your soundsystem, im open for suggestions, EO is still very new for me >.<

im trying to de-learn Stable coding  😉

Dami

PS. the class I used I found on the internet, its not mine, I just made it work with EO.

edited for something I forgot xd

DS_GetDuration ?

just stuff thats not implemented yet, dont worry about it xd

unless its a error msg, which i doubt…

Dami

may be mp3_GetDuration?

nvm, i see what ya mean, ill upload a fixed version, i forgot i renamed them at the last second xd

my bad 😛

Dami

there, uploaded the new one with correct naming >.<

sorry about that, i never should have done that in the morning anyway xd

I get compile error when adding code in eo xmas.
Compile Error :
User-defined type not defined

He’s selecting this code :

m_objBasicAudio As IBasicAudio
now go to Project>references and add a ref to active movie control type library.

added that?

Sorry forgot that :embarrassed:

It works, thanks :cheesy:

😛 no probs ^^

Dami

Hmm… how i can add it in eo xmas?

should not work that much different…

unless there is no sound system?

Dami

@erkro1:

Hmm… how I can add it in eo xmas?

The exact same way.

Oh nice! I was going for a way more complicated approach. I tend to think too hard about things xD Nice one.

im sure there are way better ways to do it actually, im sure robin could do it much better xd

but hee, it works ^^

Dami

It looks pretty good to me Dami.
Edit: I got it now…
Edit Edit: When I run it with a .mp3 song, EO freezes.

just tested it on latest EO, works fine mate, sure you followed everything?

dami

Indeed, I think it might have been the songs, because I’m trying some different .mp3s now, and it’s working smoothly.

So Thanks for this, it’s great. 😄

your welcome ^^

dami

Isn’t MP3 proprietary?

-JS1

Log in to reply