Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / April 2005

Tip: Looking for answers? Try searching our database.

How to play mp3 song file on SmartPnone

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Anurag Saxena - 08 Apr 2005 19:43 GMT
I am using Process.Start(<MP3 file Name with path>) and able to run
the specific mp3 file but not be able to stop showing WMP. I want that
I will be able to play file but not want to display WMP interface.

I am using Win32Window.SetWindowPos() method for setting the windows
position but it vein.

Also the main part which I want to include in application is that I
will be able to find all mp3 files on smartphone and display in a list
so that I would be able to select and play it.Currently I am able to
find .wav files and display in a list and user is able to play
selected file(s).

I am making application for smartphone mobile and it windows mobile
and supported Windows CE.

Well..., Vishal, Be sure about the small gift(I am sure it would not
be small one) :)...It would be appreciable if you give some light on
use of windows media player 10 OCX.I don't its availability,use and
other details.

i am using C# and Visual Studio.NET IDE.

Thanks

Anurag
Grynn - 11 Apr 2005 19:41 GMT
<cite>
I am using Process.Start(<MP3 file Name with path>) and able to run the
specific mp3 file but not be able to stop showing WMP. I want that I
will be able to play file but not want to display WMP interface.
</cite>

Hmm. Since you are really Windows Media Player as a separate
application it is hard to prevent the Windows Media Player interface
being shown. I guess you could:

1.    Start the Windows Media Player application as before
2.    Wait for Input Idle (not sure about the managed equivalent)
3.    Then send a VK_BACK to the Windows Media Player window (this will
involve doing a FindWindow() for a Window name/class which matches that
of Windows Media Player). This should cause Windows Media Player to
return focus to your application.
4.    Then when you want to stop playback, Kill the Windows Media Player
process. You won't really know when the song has finished playing
because there is no feedback from Windows Media Player.

<cite>
I am using Win32Window.SetWindowPos() method for setting the windows
position but it vein.
</cite>

Expected.

<cite>
Also the main part which I want to include in application is that I
will be able to find all mp3 files on smartphone and display in a list
so that I would be able to select and play it. Currently I am able to
find .wav files and display in a list and user is able to play selected
file(s).
</cite>

Windows Media Player 10 Mobile has a "media library"; not sure
about how easy it is to access this. Which version of the smartphone
are you targeting?

I think that it will fairly hard to make a general solution using
Windows Media Player to play your MP3 files; especially since a lot of
devices will be running Windows Media Player 9 (Smartphone 2003 pre
AKU2 and older). You may be best of porting ffMpeg or a similar
library. Alternatively you could try porting mp3sharp.

Vishal.
Anurag Saxena - 12 Apr 2005 13:39 GMT
Hello Mr. Vishal,

Thanks a lot for your guidance .

I am very new to mobile application development and this is my second
project of handheld devices,although I am developing applications for
pocket pc and using XML there since aug,2004 but I am facing these
problems first time.so pls forgive me, if u r getting frustated.

However a good news is that I got success to display playlist and user
can select the song of his choice.

I am able to get the points which you described but don't know how it
will be implemented in C# for example 'Wait for Input Idle',how to use
VK_BACK and FindWindow().

I am not starting explictly WMP.I call the process.start(<mp3 filename>)
and this line starts the media player.

There are functions of 'coredll.dll' named 'CreateProcess' and
'TerminateProcess',earlier I used 'CreateProcess' to start the
mediaplayer but at that time was not able to select the song.Now as I am
not using CreateProcess,how can I Terminate Process.Actually What I
understand is that anyhow, I should be able to kill instance of
mediaplayer or if not then atleast hide that so that when one song
finishes user able to select another,currently when I select a song from
list then...the Titlebar(on Top) and Menu(s)(on Bottom) changed to WM
Player's Title and Menu and Rest portion of window shows my application
interface but I am not able to select next song because of MP players
menu displayes not my applicaion menu.
because for song start,I select song from list and then choose
menu->play.

I am targeting windows mobile 2003 smartphone.

Now only functionality remaining is that user can select song everytime
means hide WMP interface.I am also thinking that if u guide further then
I am only 1 step back to completion.
Thanks,
Anurag

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.