View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 3 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Wed Apr 08, 2009 6:53 pm 
Offline
Joined: Wed Nov 09, 2005 1:21 pm
Posts: 161
Location: Manchester UK
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 ??

_________________
Running:-
Intel 930 3GHz dual Core
Thermaltake Fanless CPU Cooler
Asus P5GS
Samsung 750G Sata HDD
8400 512m Video Card
2 * jetway DVB-t
1 * Haupage DVB-S2 Card
Samsung Sata 16x DVDRW
2048M Ram
1 * Netop Ion 330


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 09, 2009 5:31 am 
Offline
Joined: Wed Jan 25, 2006 1:03 pm
Posts: 240
Location: Shakopee, MN USA
Check out AntiX:

http://antix.mepis.org/index.php/Main_Page

Also check out mpd/ncmpc:

http://antix.mepis.org/index.php/Command_Line_Apps


Top
 Profile  
 
PostPosted: Sun Apr 12, 2009 4:57 pm 
Offline
Joined: Sun May 30, 2004 11:05 am
Posts: 37
Location: Acton, Ontario, Canada
simonf wrote:
Hi all,
...
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 ).

Any suggestions on a distribution, and any simple devices that hay be able to do what I want ??


Simon,

Try looking at either of:

Slax (build your own custom distro on the fly)

or

TinyCore Linux (by the same guy who originated Damn Small Linux).

Both can be recast very small through the process of remastering.

Alternatively, you can try forking GeexBox from France. It already includes MPlayer natively in the build. It does UPnP out of the box and can handle SaMBa shares natively.

The source code is available for all distros if you want to recompile on your own machine.

_________________
Squiff
______________________________________
ECS K7SOM+ (v7.5c)m embedded AMD CPU
512 MB RAM, 120 GB HDD
DVD, FDD
PVR250, Plextor TV-M402U (go7007 method)
R5F27 (ACPI_wake method)
Mythwelcome


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu