From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to read playlist with wmp in labview

I have implemented the WMP apllication into labview with the ActiveX object and also loaded my desired playlist (which I earlier saved with the WMP under C:\Songs\myplaylist.wpl) through writing a constant string into the URL. So far so god. I want now to load all the songnames from this play list into my labview program. The best would be to use a WMP-Methode which delivers me a 1D Stringarray with all the songs which are in this playlist. I experimented with the Classes "Current Media" and "Current Playlist" but unfortenately, I was not able to get all the songs of this play list at once.

 

Can somebody help me out?

LabVIEW 2011
0 Kudos
Message 1 of 13
(4,837 Views)

Hi Serdj,

see the attached example.

 

Mike

Message Edited by MikeS81 on 06-23-2009 09:38 AM
0 Kudos
Message 2 of 13
(4,821 Views)

Thanx for your help Mike - it did solve my problem.

 

Now i have a new problem: When I load a playlist and use Mikes little program to read the songnames, I get the title names of all the songs, which is also what I want. As soon as this is done I start continously reading the following informations during WMP is playing - actual time, duration and name of the song.The problem is with the name-string and the duration-valure. If the WMP is in stop mode, I get the filename for the name-string and a 0 for duration. As soon as the player is playing the song, the name-string switches automaticly to the title and i get the correct duration time. I want always to get the title name and the correct duration, even when the WMP is in stop mode. Is this somehow possible?

 

This is how i read the songinformations:

 

WMP information reading

LabVIEW 2011
0 Kudos
Message 3 of 13
(4,716 Views)

Hi Serdj,

i think in "StopMode" the currentItem Refnum is empty, so you can't read anything from it.

How do you change between RUN and STOP?

Can you post your vi? 

 

Mike

0 Kudos
Message 4 of 13
(4,703 Views)

Hello Mike. I made a simple WMP LabVIEW program which is attached to this thread. As soon as i load a mp3-song (with the load-button) I get the file-name as the song-name and a 0 for duration. After I press play (on the WMP play button) this 2 informatins change. The songname is suddenly the title and the duration has a correct value. I can use some mp3-editing tool like mp3tag to change the title of a mp3 song, so that the filename and the title have same names. But it is not a nice solution. And there is still the problem with the duration value which is 0 in the begining.

 

I realized that your liddle program (attached in your first reply) gets the title-names and not the filenames, while going through that loop. I could use the "item" method of the "IWMPPLaylist Class" like you did in your for-loop. In order to do that, I need to know exactly which songnumber of a songlist is beeing played, as the "count" value for that method. How can I get that information? This would solve at least the "filename - titlename" problem. But I still dont know what to do with the duration problem?!?

 

 

LabVIEW 2011
0 Kudos
Message 5 of 13
(4,689 Views)

Is it possible to have the WMP playlist in LabVIEW like it is at the WMP usually. Where you double-click the song you want to be played? That would be awsome!

LabVIEW 2011
0 Kudos
Message 6 of 13
(4,371 Views)

Hi Serdj,

yes i think it's possible. You can use an Event Structure to get the double click event and react on it.

 

Mike

0 Kudos
Message 7 of 13
(4,358 Views)

Mike, if you tell me how, I will go to my church and ask for a blessing of Mike´s soul !!!

LabVIEW 2011
0 Kudos
Message 8 of 13
(4,347 Views)

Hi Serdj,

see the attached example.

 

Mike

Download All
0 Kudos
Message 9 of 13
(4,343 Views)

Mike thanks a LOT!

I am now able to get the songnumber which has to be played using your double-klick method (i didnt know about it earlier since I am a beginner). Now that I have the number as an I32, how do I tell WMP to play that song number? Which method is this? I am trying all different thing all day, but cant find a solution. I just want to tell WMP to play a certain songnumber (playlist has been uploaded at the beginning through the class "currentPlaylist->URL ").

LabVIEW 2011
0 Kudos
Message 10 of 13
(4,311 Views)