wmplib

change volume of mp3 playing via wmplib in c#

血红的双手。 提交于 2020-01-14 13:48:07
问题 Is it somehow possible to change the volume of a mp3-file that is playing via wmplib? Changing the volume of the program itself would be ok as well. Are there any solutions to do this? 回答1: The idea is to send WM_APPCOMMAND message (also see this answer). For WPF use WindowInteropHelper to get the Handle of the Window : class MainWindow : Window { ... private const int APPCOMMAND_VOLUME_MUTE = 0x80000; private const int WM_APPCOMMAND = 0x319; private const int APPCOMMAND_VOLUME_UP = 10 *

How to extract file path from an audio file stored in project resource folder in C#

徘徊边缘 提交于 2019-12-25 12:37:12
问题 I am having a problem extracting the file directory of an audio file which is stored in my project resource folder. In my project, I have a mysounds.resx file in which I added a file (abc.mp3). WMPLib.WindowsMediaPlayer wplayer = new WMPLib.WindowsMediaPlayer(); wplayer.URL = "E:/xyz.mp3"; wplayer.settings.setMode("loop",false); wplayer.controls.play(); Here, when I give the "E:/xyz.mp3" directory in wplayer.URL, it plays fine. But what I want to do is to get the file path from mysounds.resx

Using WMP control, volume changes main app volume

会有一股神秘感。 提交于 2019-12-13 02:25:48
问题 Using the following WMP control code, public static WMPLib.WindowsMediaPlayer player = new WMPLib.WindowsMediaPlayer(); ... And volume controls, private void button4_Click(object sender, RoutedEventArgs e) { if (player.settings.volume > 0) { player.settings.volume--; } TextBox3.Text = "Music Volume: " + player.settings.volume.ToString(); } It's basically a kind of computer karaoke, where the computer uses text to speech to 'sing' the lyrics, and wmp to play the instrumental. Unfortunately, I

WMPLib often stops playing

走远了吗. 提交于 2019-12-11 02:07:26
问题 I play mp3s and m4as with the following method: private void playmp3(string path) { WMPLib.WindowsMediaPlayer a = new WMPLib.WindowsMediaPlayer(); a.URL = path; a.controls.play(); } Usually when I play them, they only play for around 5 seconds or less and then stop playing. If i interact with the (WPF) form in any way, it also stops. I call playmp3 from a BackgroundWorker . Edit: It actually stops playing about a tenth of a second after I move my mouse. 回答1: You need to also code in the

Reference to wmp.dll (\windows\system32\wmp.dll)

别等时光非礼了梦想. 提交于 2019-12-11 01:02:10
问题 Can I use a reference to wmpLib.ddl / wmp.dll (\windows\system32\wmp.dll) in a commercial application? I am using Visual Studio 2008 Express edition. I have to deliver that DLL. 回答1: To add to Darins reply: I don't think that you can simply deploy wmp.dll with your product (I'm guessing you're thinking about doing that from the last sentence "I have to deliver that dll.")! You will have to create an installer that checks whether the correct version of the DLL is present on the target system

Zune API ZuneCore.dll

丶灬走出姿态 提交于 2019-12-03 10:09:01
问题 I noticed the other day that the Zune PC Software exposes a type library (ZuneCore.dll). It seems to be related to the WMPLib API in some way but I can't figure out how to use it either from VB6 or C#. Has anybody tried this and had any luck? Dave 回答1: May be an old question, but this link might help: http://zunelcd.codeplex.com/ If you download the source for this project one of the class libraries is a decent API for communicating with the Zune Software. 回答2: i just found out about this ->

Pausing and resuming mp3 with WMPLib and C#

和自甴很熟 提交于 2019-12-01 10:36:18
问题 I'm working on a simple mp3 player project with C# and the WMPLib library. The idea is to make it controllable with a PIC component, to control media playing in the PC from "anywhere" in my house (yes, this is a college project). The problem: I can't get the WindowsMediaPlayer.controls.play() method to resume a paused playback. How should I do it? I've already tried to save and set the WindowsMediaPlayer.controls.currentPosition property, but it doesn't work. PS: The same problem: http:/

Retrieve song name from WMP using C#

本小妞迷上赌 提交于 2019-11-28 06:25:18
问题 Using C# i'm trying to retrieve the name of the song that is currently playing and display it on a listBox, so every song that plays, it's shown in the listbox. Using System; Using WMPLib; public IWMPMedia currentMedia { get; set; } private void button1_Click(object sender, EventArgs e) { Player = new WMPLib.WindowsMediaPlayer(); string song = Player.currentMedia.name.ToString(); listBox1.Items.Add(song); } But it throws me the exception. "Object reference not set to an instance of an object"