Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Audio problem/API

  • 23-06-2008 11:03am
    #1
    Registered Users, Registered Users 2 Posts: 161 ✭✭


    Hey all,

    Does anyone have an idea how I could implement the following?

    Im trying to write a program to queue and play music. My first idea was to have a database with a table of mp3 details (id, name, dir, etc) and a table called queue which would queue up the id's of the songs to be played. Then using the following code (java):
    try{
       final String launch = "cmd /c start " + filePath;
       (Runtime.getRuntime()).exec(launch);
    } catch (IOException e) ;
    

    which would run the song in the default audio player. One problem with this way is how do I know when a song is finished- to delete the first in the queue and play the next? Anybody have any ideas to overcome this?

    Or does someone know of an api to handle this section- you dont have to limit to java, I have a little experience in C# also and I'm willing to learn anything new to accomplish this.

    Hopefully someone can help me out,
    Thanks in advance...


Comments

  • Registered Users, Registered Users 2 Posts: 2,931 ✭✭✭Ginger


    You could output the file list as a M3U file and pass that to the player. Then let the player let it handle it.

    Otherwise you will have to create a wrapper than integrates into your selected music players than can send notification that the song has finished and request a new song...


  • Registered Users, Registered Users 2 Posts: 2,013 ✭✭✭lynchie


    Have a read of JMF. It has a mp3 plugin so no need to spawn a separate process to play it.


  • Registered Users, Registered Users 2 Posts: 161 ✭✭ViperMAN


    Thanks guys-

    Had a quick look at the JMF- its looks like it does everything I need. Is there any C# APIs out there- I just want to keep all options open!


  • Closed Accounts Posts: 94 ✭✭Done and dusted


    C# API's Im not entirly sure, but i think I have seen some on the codeproject before (Some guy made his own version of winamp). If you cant find it post a message on the msdn forums in the c# section. If you do get an answer be sure to post the solution here in case someone else in the future finds themselfs in the same spot.


    Edit

    I found one of the articles on the codeproject about it: http://www.codeproject.com/KB/audio-video/mp3player.aspx its in C++ though. But it could give you a reason to go and learn a new language! I always find the that finding a solution which makes me go and learn some new technology always a good thing albeit very annoying :D

    MSDN : http://www.google.ie/search?hl=en&q=MP3+player+msdn+forums&btnG=Google+Search&meta= the first link should help too


  • Registered Users, Registered Users 2 Posts: 161 ✭✭ViperMAN


    Thanks for you help done and dusted-

    I have found the following which might be of help:
    C#:

    Thread on C# MP3 player (sample code)

    C# C-Sharpecorner Example C# Example MP3 Player

    Sdl.NET MP3 player example code


  • Advertisement
  • Closed Accounts Posts: 94 ✭✭Done and dusted


    Cool, glad I could help!

    Let us know how ya get on plus if you want someone to test the app for you I would be more than happy to give a dig out!

    Happy Coding


Advertisement