I am developing a windows form C# application that should be able to interface with iTunes. Basically, I now am able to use the iTunes COM to play music. However, when I do this, iTunes should be running since the music plays through iTunes. I was wondering if there is a way I can play music without iTunes running. Is it possible to just use the iTunes SDK to play music without starting iTunes?
No you can't. iTunesLib COM Object is just a way to control the player engine implemented in the iTunes application, and to manage the media library.
Even if you would like to implement your own player, you couldn't avoid iTunes showing up, because it's showing up when iTunes object is instanciated.
The only way is to implement your own (background) player and to parse the iTunes media library file with some XML process.
Related
I'd like to be able to press a button to play a sound of a button being pressed while music is already playing. SoundPlayer is no help because it stops the music to play the sound.
I have added the sounds to my Resources (WindowsFormsApplication2.Resources.Properties.button) and I don't want to have to type in the file location.
Answer from MerickOWA
You CANNOT play two sounds at once using SoundPlayer.
SoundPlayer is using the native WINAPI PlaySound function to accomplish the task which has no support for playing simultaneous sounds. Creating multiple instances of SoundPlayer won't help.
There are many options most of which involve implementing a lot of the low level API to window's native audio library or DirectSound (note neither are C# and require alot of interop code)
The simplest option would be to depend on windows media player to play the audio for you.
Add a reference to "C:\Windows\System32\wmp.dll"
then use
var player = new WMPLib.WindowsMediaPlayer();
player.URL = #"..\..\bin\debug\tribal dance.wav";
Note: play starts immediately after setting the URL property
The down side of this approach is your reliance on media player for your application to work properly. On the upside, you can use any file format media player supports.
I am coding a WP7 & WP8 sports tracking app that gives the user feedback through voice coaching. If a user is playing music, it needs to be paused, the voice coach needs to speak and finally the music must be resumed again. For the standard music player, i based my coding on the information given on this website, and it works for the standard music player, but not for Spotify.
I've been looking into it and the mediaplayer seems to lose track of Spotify when i pause their music, and Spotify seems to crash. There is no music in the MediaPlayer.Queue when Spotify is playing so i can't save and restore that. It's also not possible to simply try a MediaPlayer.Resume(); after pausing Spotify because the music player does not know what to play anymore due to the empty playlist.
Is it possible to create a windows phone app that is compitable with Spotify?
Thanks.
This isn't possible as 3rd party media applications such as Spotify don't use the MediaPlayer and so MediaPlayer.Resume() won't work for them.
You could request Microsoft to implement this in a future version the OS via the uservoice site.
I know how to use windows media player in my app but it doesn't work for some files.I have search the web but found nothing that could be understood about using vlc in form.Could sb help me step by step to do this please?Thanks
http://sourceforge.net/projects/libvlcnet/
http://forum.videolan.org/viewtopic.php?f=32&t=58438
NET wrapper for VLC media player. This library allows you to use libvlc from .NET code without dll imports. Simple and easy to use for playing, streaming, transcoding of video streams. Visit the home page for more info.
I have created a movie player. I'm using the default windows control for Media Player. However I just saw that some movies do not work under it(some FLV files). However those files do work under Media Player Classic. So I was thinking about using the Media Player Classic control.
However
I want this movie player to be as portable as possible. So what I would like to do is to use Media Player Classic control when its available in system, but if its NOT than use Media Player control.
Is that even possible or do I need to create two applications that share the same code?
I would recommend using libvlc. VLC is really good about playing almost anything you give it. It is a C API but one could possibly DllImport their way to success and write code in C#.
Here are some good resources to get you started:
http://wiki.videolan.org/Libvlc
http://www.helyar.net/2009/libvlc-media-player-in-c/ (Shows how to DllImport and call the C code from C#)
I need to synchronize Windows Media Player with my application. I want to show the current song that WMP is playing in a ListBox in real time, with updates when WMP changes songs. How can I implement this?
A bit of sniffing around in Google gave me this: http://brandon.fuller.name/archives/hacks/nowplaying/wmp/, it looks like you need to write a plugin for WMP that exposes the information to your application. Depending on what you need/cost, the Plugin on that page might do the job!
Poll HKEY_CURRENT_USER\SOFTWARE\Microsoft\MediaPlayer\Player\RecentFileList\File perhaps.
We've controlled Windows Media Player through the Windows Media library (wmp.dll) and .NET Remoting, using a singleton service.
Look here:
How to interact with Windows Media Player in C#