Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to play mp3 file in my program?

12 views
Skip to first unread message

Liren Zhao

unread,
Jan 10, 2005, 11:16:20 PM1/10/05
to
Is there any lib can do this ? OpenNETCF ?


Sergey Bogdanov

unread,
Jan 11, 2005, 1:20:23 AM1/11/05
to
You can use media player to play mp3 file. To invoke media player use
P/Invoke ShellExecuteEx (where just pass mp3 file) or CreateProcess
where you should specify media player as application that must be
executed and your mp3 file as argument. Also take a look at fmod
http://www.demsey.org/blog/default.aspx?date=2004-03-17

Best regards,
Sergey Bogdanov

Adam Tatusko, MCSD .NET, MCAD .NET, MCDBA, MCSE, MCSA

unread,
Jan 11, 2005, 3:51:38 PM1/11/05
to
Here's how you can do it on the .NET Framework

In your project add a reference to the ActiveMovie control type
library, it's on the COM tab.

Then use the followint code, where fileName is the name and path of
your MP3 file.

*************************
string fileName = @"C:\music.mp3";
QuartzTypeLib.FilgraphManager filgraphManager = new
QuartzTypeLib.FilgraphManager();
QuartzTypeLib.IMediaControl mediaControl =
(QuartzTypeLib.IMediaControl)filgraphManager;
mediaControl.RenderFile(fileName);
mediaControl.Run();
*************************
Also, you can use mediaControl.Stop() to stop playint the MP3

Daniel Moth

unread,
Jan 11, 2005, 3:59:09 PM1/11/05
to
...and what good is that on the CF 1.0 where COM Interop doesn't exist?!

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


"Adam Tatusko, MCSD .NET, MCAD .NET, MCDBA, MCSE, MCSA"
<adamt...@hotmail.com> wrote in message
news:1105476698.8...@f14g2000cwb.googlegroups.com...

Adam Tatusko, MCSD .NET, MCAD .NET, MCDBA, MCSE, MCSA

unread,
Jan 11, 2005, 5:49:33 PM1/11/05
to
Check out CFCOM at http://www.odysseysoftware.com/cfcom_main.html

CFCOM is a Comprehensive COM and ActiveX Interop Solution for the .NET
Compact Framework

Daniel Moth

unread,
Jan 11, 2005, 5:52:43 PM1/11/05
to
Sure... or wait for CF 2.0 that will support it out of the box...


"Adam Tatusko, MCSD .NET, MCAD .NET, MCDBA, MCSE, MCSA"
<adamt...@hotmail.com> wrote in message

news:1105483773.1...@z14g2000cwz.googlegroups.com...

Malc

unread,
Jan 12, 2005, 6:06:32 AM1/12/05
to
Or use fmodce (www.fmod.org. Free for non-commercial use.

blurb: "FMOD supports 3d sound, midi, mods, mp3, ogg vorbis, wma, aiff,
recording, obstruction/occlusion, cd playback (analog or digital), cd
ripping, mmx, internet streaming, dsp effects, spectrum analysis, user
created samples and streams, synchronization support, ASIO, EAX 2&3,
C/C++/VB/Delphi and more."

Lane Kuo has written a very nice .NET CF wrapper in his smartphone alarm
project.
http://sourceforge.net/projects/spalarm/

The library can easily be extended to add support for the callbacks using
the standard technique of another native dll which posts messages to a
MessageWindow class in your .NET app.


fmodce is free for non commercial use and it rocks.

On Tue, 11 Jan 2005 22:52:43 -0000, Daniel Moth <dmo...@hotmail.com>
wrote:

--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/

Stelrad Doulton

unread,
Jan 12, 2005, 3:16:59 PM1/12/05
to
Sorry, a bit off topic. but can you expand on the "standard technique of
another native dll which posts messages to a MessageWindow class in your
.NET app"

cheers

"Malc" <malcolm...@wififofum.org> wrote in message
news:opskhk46u1z13z1w@cruz...

0 new messages