Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[EO] Adding Mp3 support to EO - VERY BASIC


damian666
 Share

Recommended Posts

  • Replies 109
  • Created
  • Last Reply

Top Posters In This Topic

@Anŧhøñy:

> Are you using the latest version of Origins?  Only replace that if your version is using the cache (check if the code above it is using "frmEditor_MapProperties.lstMusic.AddItem strLoad" or not; if it is, use the older version).

I'm using EO v2 Beta..
And its using frmEditor_MapProperties.lstMusic.AddItem strLoad
Link to comment
Share on other sites

@erkro1:

> I'm using EO v2 Beta..
> And its using frmEditor_MapProperties.lstMusic.AddItem strLoad

Okay, I think it's better if I clarify.
When looking in your PopulateLists sub, if you see:
```
' 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

```Then use this code:
```
    strLoad = Dir(App.Path & MUSIC_PATH & "*.mp3")
    Do While strLoad > vbNullString
      frmEditor_MapProperties.lstMusic.AddItem strLoad
      strLoad = Dir
    Loop

```
If you see:
```
    strLoad = Dir(App.Path & MUSIC_PATH & "*.mid")
    Do While strLoad > vbNullString
        ReDim Preserve musicCache(1 To i) As String
        musicCache(i) = strLoad
        strLoad = Dir
        i = i + 1
    Loop

```Then use this code:
```
    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

```
Link to comment
Share on other sites

@Markz88:

> There is a bug!
> If we have a map with a midi music and a one with mp3 music, when we are in the midi map and we warp to the mp3 map, the midi music never stop… same for the reverse.. how to resolve it?

Only use either mp3s or midis, then. :3
Link to comment
Share on other sites

@Admiral:

> Okay, I think it's better if I clarify.
> When looking in your PopulateLists sub, if you see:
> ```
> ' 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
>
> ```Then use this code:
> ```
>     strLoad = Dir(App.Path & MUSIC_PATH & "*.mp3")
>     Do While strLoad > vbNullString
>       frmEditor_MapProperties.lstMusic.AddItem strLoad
>       strLoad = Dir
>     Loop
>
> ```
> If you see:
> ```
>     strLoad = Dir(App.Path & MUSIC_PATH & "*.mid")
>     Do While strLoad > vbNullString
>         ReDim Preserve musicCache(1 To i) As String
>         musicCache(i) = strLoad
>         strLoad = Dir
>         i = i + 1
>     Loop
>
> ```Then use this code:
> ```
>     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
>
> ```

-woet-
Thanks it works :D
Link to comment
Share on other sites

Ok i got all in but i got a problem it don't want to play my mp3 music its listed in properties but when i push play i dont wanna play it.

Im using 2.0

these are my codes

```
Public Sub PopulateLists()
Dim strLoad As String, i As Long

    ' If debug mode, handle error then exit out
    If Options.Debug = 1 Then On Error GoTo errorhandler

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

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

```
and second

```
  ' Calculate fps
        If TickFPS < Tick Then
            GameFPS = FPS
            TickFPS = Tick + 1000
            FPS = 0
        Else
            FPS = FPS + 1
        End If
        'loop mapmusic if needed and its a mp3 file
        LoopMp3
    Loop

```

so whats worng ò.O
Link to comment
Share on other sites

ok i still got no sound if i want to play my mp3\. I dont know why :/ i habe done all here in the thread but nothing is working :/
i hope some one got an idea to help me.

(must it be on server and client side or only on client side?)
Link to comment
Share on other sites

  • 3 weeks later...
> I have everything working except the class wont seem to play any mp3\. It shoots a "Object doesnt support this action. Runtime error '445' and then selects the line:
> If CLng(m_objMediaPosition.CurrentPosition) = CLng(m_objMediaPosition.Duration) Then
> inside of the public Playmp3 function.

Scratch that, apparently the mp3's i was using were formatted differently, tried different files, and works nice. Thanks!
Link to comment
Share on other sites

  • 2 months later...
Now in modGeneral, in Public sub PopulateLists, look for :

Code: [Select]

' 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

I just only find the half of the code so I paste the missing part and everything is work fine O.o
Link to comment
Share on other sites

  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share


×
×
  • Create New...