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

[EO3] fmod and internet streaming


Justin Knight
 Share

Recommended Posts

I thought fmod supported internet streaming. I was wondering if someone could please help me edit the client to play m3u files for internet radio streams. The files I'm trying to play can be found here [http://srvr2.serve-everything.com:8003/](http://srvr2.serve-everything.com:8003/)

If anyone has at least a starting point for solving this issue I would love to hear from you. Thank you!
Link to comment
Share on other sites

> I thought fmod supported internet streaming. I was wondering if someone could please help me edit the client to play m3u files for internet radio streams. The files I'm trying to play can be found here [http://srvr2.serve-everything.com:8003/](http://srvr2.serve-everything.com:8003/)
>
>  
>
> If anyone has at least a starting point for solving this issue I would love to hear from you. Thank you!

fmod does support streaming. But fmod  must support the file format that you are streaming from. I don't think fmod supports m3u files. Moreover, I don't think a documentation for the old fmod (which is the one being used in the engines here) exists anymore. Though, you could try googling the fmod version with the documentation.
Link to comment
Share on other sites

Is there a way I can handle when the stream url fails to load in this example?

```
Public Sub PlayMusic(ByVal song As String)
Dim tmpurl As String

If Not INIT_MUSIC Then Exit Sub

' exit out early if we have the system turned off
If Options.Music = 0 Then Exit Sub

' does it exist?
If Not FileExist(App.Path & MUSIC_PATH & song, True) Then Exit Sub

' don't re-start currently playing songs
If curSong = song Then Exit Sub

' stop the existing music
StopMusic

' find the extension
Select Case Right$(song, 4)
Case ".mid", ".s3m", ".mod"
' open the song
songHandle = FMUSIC_LoadSong(App.Path & MUSIC_PATH & song)
' play it
FMUSIC_PlaySong songHandle
' set volume
FMUSIC_SetMasterVolume songHandle, 150

Case ".wav", ".mp3", ".ogg", ".wma"
' open the stream
streamHandle = FSOUND_Stream_Open(App.Path & MUSIC_PATH & song, FSOUND_LOOP_NORMAL, 0, 0)
' play it
FSOUND_Stream_Play 0, streamHandle
' set volume
FSOUND_SetVolume streamHandle, 150

Case ".txt"

'open file and read
tmpurl = FileText(App.Path & MUSIC_PATH & song)

' open the stream
streamHandle = FSOUND_Stream_Open(tmpurl, FSOUND_LOOP_OFF, 0, 0)
' play it
FSOUND_Stream_Play 0, streamHandle
' set volume
FSOUND_SetVolume streamHandle, 150

Case Else
Exit Sub
End Select

' new current song
curSong = song

End Sub 
```
Link to comment
Share on other sites

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...