I Need Help Trying to Play (.pls) files in a simple windows forms Application

 So I'm try to build application that when I click on the icon it opens a little window and play the url .pls. I already got the graphics of the app i just to get the code and I've been looking around for but all i got was this code
typedef struct
int count;
void **name;
void **displayname;
} Playlist;
Playlist* my_playlist; // SHOUTCAST PLAYLIST
#define BOX(text) MessageBox(NULL,text,"Info",MB_OK | MB_TOPMOST);
char *stristr(char *string2, char *string1) // from /samples/fmod/Main.c
char *s1 = strdup(string1);
char *s2 = strdup(string2);
char *ret = 0;
int i, j;
int len1 = (int)strlen(string1);
int len2 = (int)strlen(string2);
for (i=0;s1[i];i++) s1[i] = tolower(s1[i]);
for (i=0;s2[i];i++) s2[i] = tolower(s2[i]);
for (j=0;j < (len2 - len1);j++)
char *a = s1;
char *b = &s2[j];
for (i=0;(i < len1) && *a && *b;a++, b++, i++)
if (*a != *b)
break;
if (i == len1)
ret = &string2[j];
break;
free(s1);
free(s2);
return ret;
Playlist *ParsePlaylist(char *name) // from /samples/fmod/Main.c and MSDN
char *filebuf, *p;
Playlist *playlist = 0;
int count, i;
// Check if URL is null
if (!name)
BOX("Streaming URL is empty");
return 0;
// Check if URL is a *.pls file
if (_stricmp((const char *)".pls", (const char *)(&name[strlen(name) - 4])))
return 0;
// Create a WinInet session
HINTERNET hSession = InternetOpen(_T(""), INTERNET_OPEN_TYPE_PRECONFIG, 0, 0, 0);
// Prepare a request
HINTERNET hRequest = InternetOpenUrl(hSession, name, 0, 0, 0, 0);
// Send the HTTP request.
HttpSendRequest(hRequest, 0, 0, 0, 0);
// Read the response data.
DWORD dwNumberOfBytesAvailable = 0;
do
// Retrieve size of remote file
InternetQueryDataAvailable(hRequest, &dwNumberOfBytesAvailable, 0, 0);
if (0 < dwNumberOfBytesAvailable)
// Allocate buffer memory
filebuf = new char[dwNumberOfBytesAvailable + 1];
filebuf[dwNumberOfBytesAvailable] = 0;
DWORD dwBytesRead = 0;
// Read remote file and put in buffer
InternetReadFile(hRequest,
filebuf,
dwNumberOfBytesAvailable,
&dwBytesRead);
//BOX(filebuf);
while (0 < dwNumberOfBytesAvailable);
// Close the request handle.
InternetCloseHandle(hRequest);
// Close the WinInet session.
InternetCloseHandle(hSession);
// Parse the pls file (from Fmod sample)
p = stristr(filebuf, "NumberOfEntries=");
if (!p)
BOX("Streaming : NumberOfEntries in pls file not found");
return 0;
p += 16;
count = atoi(p);
if (!count)
BOX("Streaming : numeric value for NumberOfEntries not found");
return 0;
playlist = (Playlist *)calloc(sizeof(Playlist), 1);
if (!playlist)
BOX("Streaming : can't allocate memory for pls file (playlist)");
return 0;
playlist->count = count;
playlist->name = (void **)calloc(sizeof(char *) * count, 1);
if (!playlist->name)
BOX("Streaming : can't allocate memory for pls file (playlist->name)");
return 0;
playlist->displayname = (void **)calloc(sizeof(char *) * count, 1);
if (!playlist->displayname)
BOX("Streaming : can't allocate memory for pls file (playlist->displayname)");
return 0;
for (i=0;i < count;i++)
char tmp[32];
char *filename, *displayname, *t;
filename = displayname = 0;
sprintf(tmp, "File%d=", i + 1);
p = strstr(filebuf, tmp);
if (p)
p += strlen(tmp);
t = p;
for (;*t && (*t != 0xa) && (*t != 0xd);t++);
if (*t)
char tmpc = *t;
*t = 0;
filename = _strdup(p);
*t = tmpc;
if (strncmp(filename, "http://", 7) && strncmp(filename, "http:\\\\", 7))
char *tmpname = _strdup(filename);
p = &tmpname[strlen(tmpname) - 1];
for (;(p > tmpname) && (*p != '\\') && (*p != '/');p--);
if ((*p == '\\') || (*p == '/'))
p++;
displayname = _strdup(p);
free(tmpname);
playlist->name[i] = filename;
playlist->displayname[i] = displayname;
free(filebuf);
return playlist;
[main code]
char string_music[256] = "http://www.shoutcast.com/sbin/shoutcast-playlist.pls?rn=6042&file=filename.pls"; // For example
// Parse the remote file (in case it's a Shoutcast playlist (*.pls))
my_playlist = ParsePlaylist(string_music);
if (my_playlist)
strcpy(string_music, (char*) my_playlist->name[0]); // for the first song in the playlist
FSOUND_STREAM * my_stream = FSOUND_Stream_Open(string_music, FSOUND_NORMAL | FSOUND_NONBLOCKING, 0, 0);
int int_sound_mp3 = FSOUND_Stream_Play(FSOUND_FREE, my_stream);
and i got to link it to Wininet.lib
and I'm a noob so i got problems as soon as i tried to put everything together
so any help greatly appreciated 
BTW if you know any other ways, that I'll be able to stream the audio that will be great to.
heres the link for the audio stream (.pls)
http://panel3.serverhostingcenter.com:2199/tunein/nrlsxglp.pls

Hello 0cooldex0,
What library do you used in this scenario? I haven't saw this FSOUND_STREAM from MSDN library.
By the way, winform general is used for talking about Windows Form library, is is using C# or VB.NET but not C or C++. You are not posting in the right forum.
In my point of view, you may choose the forum depending on the library you choosed and post on specific forum.
Regards,
Barry
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Best file location for VS2013 Windows Form applications on a stand alone PC (Windows 7) upgrading from VS2008 Standard?

    Hi and Help,
    I'm in the process of upgrading my VS2008.Standard Windows Forms apps to VS2013.Pro.  My concern is I've got the VS2008 apps scattered in folders all over my disc; this includes the VS2008 published apps. 
    All of the converted apps are being stored in one folder,
    VB13_AppSource, in their own sub-folders.  (I don't know if it makes any difference here, but all of these apps, except one which is a Sudoku screen app, use SQL2005.Express.  After I've made all the conversions, I'll upgrade SQL
    to the latest Express available down the road in several months.  Included will be an upgrade from my current SSMS to the latest SQL Server Management Studio. )
    What I'd like from you are recommendations and document locations on how to store VS2013 apps on my C drive.  Please note that I'm using Net 4.5.1.  Some of my thoughts are:
    Source folder for all applications
    Folder for all published apps
    Folder for Class Library(s?)
    Folder for Active SQL Databases
    Folder for Test SQL Databases
    Thanks for your help,
    Terry 01

    Hi Terry01,
    Thanks for your reply.
    Based on your issue, I suggest you can refer the Jack's suggestion to check your issue from the follwoing
    thread.
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/3d128a21-f3b5-430e-b146-60eea577194f/converting-vs-2005-project-to-vs-2013?forum=visualstudiogeneral
    In addition, I find some msdn document about how to upgrade the project to VS2013, you can refer it.
    https://msdn.microsoft.com/en-us/library/hh690665.aspx
    https://msdn.microsoft.com/en-us/library/ms185327.aspx
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Sound but no Video when trying to play video files - HELP!

    I am trying to play video files via Elements Organizer. In this case it is .MOV files. The new screen pops up but all I get is the sound and no video. I have downloaded the newest quicktime player but it did not help. Any ideas?

    Hi,
    What happens when you play the same file outside Organizer?

  • HT3775 hi, what do i need to do to play AVI file on my new macbook pro

    hi, what do i need to do to play AVI file on my new macbook pro

    Try installing Perian.
    (66938)

  • I need help viewing password protected PDF files on my tablet

    I need help veiwing password protected PDF files on my tablet

    Any free apps available especially for this purpose?
    not that i know of. but i think _*Documents To Go*_ will be worth the expenditure.
    JGG
    edited by the Jolly Green Giant (where Green stands for environmentally friendly)

  • I had to put my computer by together without migration or time machine I NEED help with order of the files?

    I had to put my computer by together without migration or time machine I NEED help with order of the files?

    Hi, where are these other files exactly?

  • HT5622 I need help trying to figure out why I'm not able to purchase anythi iTunes. I changed my password, that didn't help. I changed my payment type, that didn't help. It initially started when my password got disabled. Any advice?

    I need help trying to figure out why I'm not able to purchase anything on iTunes. I changed my password, that didn't help. I changed my payment type, that didn't help. It initially started when my password got disabled. Any advice?

    I need help trying to figure out why I'm not able to purchase anything on iTunes. I changed my password, that didn't help. I changed my payment type, that didn't help. It initially started when my password got disabled. Any advice?

  • Need help trying to use close button and i really like to know why it off

    need help trying to use close button and i really like to know why it off

    And in English? You need to explain better.
    Mylenium

  • This is detailed: I lost my touch pad scroll ability on my desktop when I installed Firefox, I am having a terrible time trying to sync my new Android tablet to my desktop, my desktop Firefox is acting very strangly (I need help trying to use it)

    My Vista Home Premium desktop has not used Firefox for a long time. I just loaded it as well as on my Honeycomb Android. The statement that I made pretty much says what my problem is. I can use both of them at the same time and use a router with the air Verizon card installed.
    I'll repeat my question: This is detailed: I lost my touch pad scroll ability on my desktop when I installed Firefox, I am having a terrible time trying to sync my new Android tablet to my desktop, my desktop Firefox is acting very strangely (I need help trying to use it)

    My Vista Home Premium desktop has not used Firefox for a long time. I just loaded it as well as on my Honeycomb Android. The statement that I made pretty much says what my problem is. I can use both of them at the same time and use a router with the air Verizon card installed.
    I'll repeat my question: This is detailed: I lost my touch pad scroll ability on my desktop when I installed Firefox, I am having a terrible time trying to sync my new Android tablet to my desktop, my desktop Firefox is acting very strangely (I need help trying to use it)

  • I need help trying to activate my new phone online where do i go??

    i need help trying to activate my new phone online where do i go??

    Log in to your MyVerizon (verizonwireless.com) and on the Overview page scroll down to I WANT TO... in the third column of boxes, under DEVICE, the 3rd one down is "Activate or Switch Device".  Click on that and follow the instructions.  If there is an issue, it will instruct you to call customer service or you will be connected to customer service automatically.  Let us know if this works...

  • I need help trying to access my spotlight messages.

    I need help trying to access my spotlight messages.  I type in the persons name and only one text comes up but when I type in words in the text other ones come up.  So what I need to do is get all those text messages if its possible.

    I know the texts are there, but like I said it depends on the spotlight search but I want them all in one.

  • Need help trying to transfer my information from one iphone to another

    need help trying to transfer my information from one iphone to another

    If you are restoring from an icloud backup you are going to have to erase a content and setting and while in the setup prompts you will get the option to restore from an icloud back...that's the only time you will get the option to restore from an icloud back and that's during setup

  • [Locked] Really need help trying to log users

    I really need help trying to show when members have logged in.  This is my second post and and the code that I was given, didn't work and now I can't get anyone to tell me what is wrong with it.  Here is the code and error message:
    Error message is "Unknown column 'billsmith' in 'where clause'
    Here is the code I am using:
    mysql_select_db($database_connRegister, $connRegister);
    $logged_in_user = "-1";
    if(isset($_SESSION['MM_Username'])) {
    $logged_in_user=$_SESSION['MM_Username'];
    $query_online_now = "UPDATE users SET logged_in='Online', last_login_date=NOW() WHERE user_name=$logged_in_user";
    $online_now = mysql_query($query_online_now, $connRegister) or die(mysql_error()); }
    $query_not_online_now="UPDATE users SET logged_in='Offline' WHERE last_login_date<NOW() - INTERVAL 60 MINUTE";
    $not_online_now=mysql_query($query_not_online_now, $connRegister) or die(mysql_error());
    Can someone please tell me why it isn't working?

    This question has been answered here: http://forums.adobe.com/message/2351465#2351465.
    Locking this thread to avoid duplication. Please reply in the original thread if any further help is needed.

  • Need help to share Number/Pages file visa Mail option. Cannot do with iPad Air (iOS7)

    Need help to share Number/Pages file visa Mail option. Cannot do with iPad Air

    Oh, okay. After selecting the format I want to send, it says "creating... ". Then irrespective of the format I choose the message e.g. "creating spreadsheet" disappears, and so does the choice window (where I earlier chose Mail). I am taken back to the Numbers (or Page) where I had started from. Diavonex's note indicated that after "creating ... " stage I should be taken to an option where I can type in email address where I want to  send the  file, if I want to copy it to another address etc. I cannot arrive at that page - no matter whether I am working with Pages or Number, or which format I choose for the file to share !
    I will try to close as you have suggested and try. However, I have switched on and off several times by now, but nothing changed!
    Will look forward to any ideas to solve this !!!
    Thanks much!
    Best

  • I'm trying to play MIDI files in Quicktime. It works buy the volume is very low, even with both Quicktime and computer volume on max. What can I do?

    I'm trying to play MIDI files in Quicktime. It works buy the volume is very low, even with both Quicktime and computer volume on max. What can I do?

    I'm having the same issue.  After opening Audio Midi Setup in Utilities I noticed that the master volume slider of the Built-In Output is very low.  I am not able to slide to get any more level out of the system.
    Can you adjust the master volume on your system?

Maybe you are looking for

  • Unable to disconnect - files used by another program?

    Looking for some help. Last few times I've connected my iPod to my computer, it won't let me eject it after the update is complete. When I click either eject button, I get a message claiming that some of the files are being used by another program an

  • Print preview of smartform in word format (editable)

    Hi Everybody, I have a smartform. I want, when i click on the print priview , it should display in Ms word format and that to editable. Plz help. Thanks, Mohammadi.

  • Auto provsioning with wcs and 4404 controlers

    i'm about to add several new controlers to my network and would like to use the Auto provisioning feature to help out. the only problem i have is i havn't got involved in setting up the DHCP on a the network that is managed by our server team so i ne

  • PermGen space Error in Weblogic Server

    Hi, I am facing problem with Premgen space; java.lang.outofMemory+, while deploying (Importing the jar file in the server) my service in the Server, I need to restart the Server each and every time due to this problem. I am currently using Weblogic 1

  • Cant open old photos!

    I have a number of old photos from the system 7-9.x days that for some reason cannot be opened in Mountain Lion in Preview. Is there a way around this, or ws this my mistake that I made in not keeping a older OS 8.x Mac around? I also have some old p