Tim Anderson's ITWriting [Valid RSS]

Tech writing blog

Blog Home RSS Archives ITWriting.com
Add to Feedburner Add to Bloglines Add to Newsgator Add to My Yahoo

January 5, 2005

Automating Windows Media Player

Posted 2066 days ago on January 5, 2005

As a journalist, I tend to record numerous press briefings and interviews, and sometimes I have the arduous task of transcribing parts of them. Some time ago I shifted from minidisk to a hard disk MP3 player/recorder (my review is here). Generally this works very well, and I much prefer working with MP3 files than with stacks of little plastic disks that tend to disappear under piles of paper on the desk. So I load the file into Windows Media Player, open up Word, and switch between Word and WMP in order to control playback.

At least, I used to do this. I've been meaning for ages to see whether I could easily create some keyboard shortcuts in Word to control the player. Today I spent half an hour on this, and it turns out to be very easy. I've set a reference to the Windows Media Player OCX, and made shortcuts for Open, Pause, Play, Go back a bit, Go forward a bit, and Go to position (this one opens an input box). Mind you, I still can't find the documentation for the OCX in the Media Player SDK; I'm using the little help strings in the VBA object browser.

It's great, a big improvement over alt-tab. There are a few mysteries to solve when I get a moment. I've put the macros in Normal.dot; I think it may work better as a COM add-in since I want to keep a reference to the active media player object at the application level, not at the document level. Getting a bit more ambitious, it would be neat to display the current position in the status bar. And why stop at transcribing? Since I spend so much time in Word, how about some music playlists, paused at the touch of a key when the telephone rings?

All in all, it reminds me how much I like VBA in Office. It's amazing how much a few quick macros can improve your productivity.



Re: Automating Windows Media Player

Posted 2060 days ago by Phil • • • Reply

That sounds interesting. Can you share the VBA code for the Word macro?

Re: Automating Windows Media Player

Posted 2060 days ago by Tim Anderson • • • Reply

Sure. I've uploaded the code here:

http://www.itwriting.com/wordmedia.zip

You might also want to look at the free Express Scribe at:

http://www.nch.com.au/scribe

This one is not Word-specific but uses system-wide keyboard shortcuts.

Tim

Re: Automating Windows Media Player

Posted 1818 days ago by Karen • • • Reply

Hi,

The macros are a great idea and I am looking forward to using them with WM Player. However, I get an error message saying that the macro is disabled. Can you tell me how to allow the macro to run? Also, do I assign my own keystrokes to run the individual macros?

Re: Automating Windows Media Player

Posted 1818 days ago by Tim Anderson • • • Reply

Karen, you need to select Tools - Macro - Security in Word and change the setting to at least Medium. Alternatively, it should be possible to move the template to a trusted location to enable the macros - eg. your normal location for Word templates. You don't need to assign your own keystrokes.

Re: Automating Windows Media Player

Posted 853 days ago by Fran • • • Reply

I'm trying to use the VBA code for using Windows Media Player 11 while in Word 2003 in Vista to transcribe an Audio CD. I copied the code as a template and opened the template file, but the macros will not work. Is there an updated version of this code that I may use?

Fran

Re: Automating Windows Media Player

Posted 844 days ago by Tim Anderson • • • Reply

@Fran

Yes, I believe the ActiveX component I used in this is not present in Vista. I rewrote the macro for Office 2007 and used the ActiveMovie (Quartz) control instead, see:

http://www.itwriting.com/blog/?p=454

You could adapt the macro to use this and it will likely work fine.

Tim

Re: Automating Windows Media Player

Posted 2000 days ago by Guy Rondeau • • • Reply

Check out vpedal.com for a footpedal that can be used while transcribing from audio files.

Re: Automating Windows Media Player

Posted 1973 days ago by Chris • • • Reply

Is there an ActiveX control I need to include with this? And where could I find that .ocx?

Re: Automating Windows Media Player

Posted 1887 days ago by Tim Anderson • • • Reply

Chris, you don't need an ActiveX control as such, just install the latest Windows Media Player

Re: Automating Windows Media Player

Posted 1786 days ago by grawmet • • • Reply

i was looking for a way to insert a pause in a macro. this is one of the first places i checked so i figured i'd ask you guys. is there a way to insert a pause in the word macros and if so, what is the code to perform this act? thanks.

Re: Automating Windows Media Player

Posted 1786 days ago by Tim Anderson • • • Reply

Not really the place for this ... but have a look at http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20843293.html which gives several ways to pause a VB application.

Re: Automating Windows Media Player

Posted 1597 days ago by tony • • • Reply

if you want to find some Automating Windows Media Player
go http://www.yaodownload.com , i also found some useful tools there.

Re: Automating Windows Media Player

Posted 1571 days ago by govardhan • • • Reply

HELLO,

THE PLAYER IS EXCELLENT.

Can it be configured to work with footpedal using Mscomm32.ocx.

(I gave a reference to Mscomm32.ocx and tried to add it as a additional control in a form.... it shows the error could not initiate as the control does not have a licence, for this, i have manually regsvr32 the mscomm32.ocx, but it shows the same error.

I am in the field of Medical Transcription. If you can tell me how to do this, it will be of great help.

I also have a similar media player which works in the same manner but it takes the reference to windowsmediaplayer.ocx and has the functionality of play, pause, rewind, forward, bookmark, loop, show controls, step size, faster, slower, normal, open etc. It is also a document template in VBA.

I am not a software developer, but have basic knowledge. I am a hardcore Medical Transcriptionist with Technical edge to know things.

Regards,

Chakri

Re: Automating Windows Media Player

Posted 988 days ago by Allegra • • wwwReply

I want to run windows macros across several applications including windows media player and excel... does anyone know any good software for doing this

Re: Automating Windows Media Player

Posted 787 days ago by Jonathan Melvin • • wwwReply

We are involved in a granted-funded research project at the Regional Research Institute. We have a large amount of video data we need to “code,” i.e. noting events that happened in the video (did youth show initiative, did youth respond to a question, etc).

Can you suggest a method to control Windows Media Player (or any other Windows-based media player)? Once video starts, we need the player to automatically pause playback after 20 seconds. Once the user resumes playback, the video needs to pause again after another 20 seconds, and so on.

We would really appreciate your assistance with this. Thank you for your time!

Re: Automating Windows Media Player

Posted 781 days ago by Tim Anderson • • • Reply

Jonathan,

I'd have thought the COM API would allow that. When I get a moment I'll look into it.

Tim

Re: Automating Windows Media Player

Posted 715 days ago by evan kelly - support @ vpedal • • wwwReply

We @ vpedal.com have a plugin that works with wmp9 > 11+ winamp / itunes / quicktime / realplayer /
we also have an api

Re: Automating Windows Media Player

Posted 49 days ago by Ethan Madison, Jr. • • wwwReply

you can try audacity too


<a href=http://www-transcription.net/transcription-school/"> Transcription School </a>


Add Comment

You are welcome to comment below. For your guidance, HTML is not supported and URLs will be displayed as plain text.

 Title

 Name

 Email - Optional, not displayed

 Website. Make Public?

Your comment

Please enter this code below:

 Code

Recent posts

Users plead with Borland to give up .NET
IE7 to be released 18th October,...
If Microsoft doesn't use UAC, why...
Google's unsettling lack of direction
Vista security: now prove it


Powered by bBlog