Hi all,
This is probably the wrong place to ask but ill start here anyhow
I am trying to make a simple background music player I provided a demo of the app based on the following VB.net code
Code:
Module Client
Dim WithEvents WMP As Microsoft.DirectX.AudioVideoPlayback.Audio = Nothing
Dim Playing As Boolean = False
Dim NextTrack As String = ""
Const ServerDownloadsPath = "http://www.XXXXXXXX.com/media/servlet/secure/audio/mpeg/"
Sub Main()
Console.WriteLine(Now() & " Starting ")
Console.WriteLine(Now() & " SMS Jukebox Client ")
Console.WriteLine(Now() & " (c) Simon Flanagan ")
Console.WriteLine(Now() & " 2009 ")
Console.WriteLine(Now() & " Waiting For First Item ")
While True
If NextTrack > "" Then
If Not My.Computer.FileSystem.FileExists(NextTrack) Then
Console.WriteLine(Now() & " Downloading : " & NextTrack)
Try
My.Computer.Network.DownloadFile( _
ServerDownloadsPath & NextTrack, _
NextTrack, _
"XXXXXX", "XXXX")
Catch ex As Exception
End Try
End If
If Not Playing Then
PlayTrack(NextTrack)
NextTrack = ""
End If
Else
NextTrack = DownloadString("http://XXXX.XXX/nextqueueitem.aspx")
If NextTrack > "" Then
Console.WriteLine(Now() & " Queued : " & NextTrack)
End If
End If
'wait a second
Threading.Thread.Sleep(1000)
If Playing AndAlso WMP.CurrentPosition = WMP.Duration Then
Playing = False
End If
End While
End Sub
Sub PlayTrack(ByVal Filename As String)
Console.WriteLine(Now() & " Playing : " & Filename)
Try
If IsNothing(WMP) Then
WMP = New Microsoft.DirectX.AudioVideoPlayback.Audio( _
Filename, True)
Else
WMP.Open( _
Filename, True)
End If
Playing = True
Catch ex As Exception
End Try
End Sub
Public Function DownloadString(ByVal address As String) As String
Try
Dim client As System.Net.WebClient = New System.Net.WebClient()
Dim reply As String = client.DownloadString(address)
Return reply
Catch ex As Exception
Return ""
End Try
End Function
End Module
Basically what it does is listens to a http server for the name of the next track, if the track does not exists then it downloads it. Then it plays the track.
I want to find a very lite linux distribution suitable for doing the same task and maybe impiment this as a script i have done a little bit of scripting before (mostly adjusting others scripts to suit my needs ).
I am sure it could be done in less than 10 lines of script using say mplayer as the player.
I thought of altering my code above to use mplayer then using MONO but it did seem a little over the top.
I initialy will be running this on a very lite pc based system but hopefully want to run it on something much simpler maybe an ARM based HDD media Player I want to try and bring the cost per unit below 150$US
Any suggestions on a distribution, and any simple devices that hay be able to do what I want ??