| Mirage Source http://www.miragesource.net/forums/ |
|
| Looping Sound http://www.miragesource.net/forums/viewtopic.php?f=210&t=2632 |
Page 1 of 1 |
| Author: | shaded [ Thu Sep 06, 2007 1:58 am ] |
| Post subject: | Looping Sound |
Code: Public CurrentSong As String Dim mssg As String * 255 Dim MIDIpos As Integer Dim MIDILength As Integer Public Sub PlayMidi(Song As String) Dim i As Long If CurrentSong <> Song Then i = mciSendString("close all", 0, 0, 0) i = mciSendString("open """ & App.Path & MUSIC_PATH & Song & """ type sequencer alias background", 0, 0, 0) i = mciSendString("play background notify", 0, 0, frmMirage.hWnd) i = mciSendString("status background length", mssg, 255, 0) MIDILength = mssg CurrentSong = Song Else If MIDILength = MIDIpos Then i = mciSendString("play background from 0", 0&, 0, 0) End If End If i = mciSendString("status background position", mssg, 255, 0) MIDIpos = mssg End Sub Just place: Code: If Map.Music > 0 Then Call PlayMidi("music" & Trim(STR(Map.Music)) & ".mid") End If .....into GameLoop I know a lot of people have switched to directsound, Fmod, etc. |
|
| Author: | Robin [ Thu Sep 06, 2007 3:23 pm ] |
| Post subject: | Re: Looping Sound |
There's already a tutorial for this. |
|
| Author: | shaded [ Thu Sep 06, 2007 4:07 pm ] |
| Post subject: | Re: Looping Sound |
Sorry, I did a search before, but never found one. |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|