Solved

Embed music into a script

Posted on 2009-04-06
4
228 Views
Last Modified: 2013-12-08
I am trying to embed a song into a login script.  I already have a picture pop up within a ie window.  Can someone tell me what I need to add to make sound too.  Thanks.
Option Explicit
 
Const cIMG = "<img src='file:\\Tmc0100dc01\SYSVOL\tmc.com\scripts\picture.jpg' border='1'>"
 
Dim oIEA : Set oIEA = CreateObject("InternetExplorer.Application")
With oIEA
  .ToolBar = 0
  .AddressBar =false
  .StatusBar = 0
  .Width = 490
  .Height = 430
  .Left = 0
  .Top = 0
  .MenuBar = false
  .Navigate "about:blank"
  While oIEA.Busy
  Wend
  .Document.Title = "Generic Text!!"
  .Document.Body.InnerHTML = cIMG
  .Visible = 1
End With 
 
WScript.Sleep 30 * 1000
 
On Error Resume Next 
oIEA.Quit
set oIEA = Nothing

Open in new window

0
Comment
Question by:KodiBear
  • 3
4 Comments
 
LVL 65

Expert Comment

by:RobSampson
ID: 24084325
Hi there....WAV files can be played:
http://www.microsoft.com/technet/scriptcenter/resources/qanda/nov04/hey1103.mspx

and other files could probably be played using WMPlayer, but I don't have any code accessible for that at the moment....

Regards,

Rob.
0
 
LVL 65

Accepted Solution

by:
RobSampson earned 500 total points
ID: 24084335
Wait, check this page out for WMPlayer....
http://www.microsoft.com/technet/scriptcenter/funzone/player.mspx

Under this section:
Retrieving  and Playing  an Individual Song

'===============================
Set objPlayer = CreateObject("WMPlayer.OCX" )

Set objMediaCollection = objPlayer.MediaCollection
Set objTempList = objMediaCollection.getByName _
    ("I Hate Myself for Loving You")

Set objSong = objTempList.Item(0)
objPlayer.OpenPlayer(objSong.sourceURL)
'===============================

Regards,

Rob.
0
 

Author Closing Comment

by:KodiBear
ID: 31567347
Thank you.  I appreciate the help.
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 24091961
No problem. Thanks for the grade.

Regards,

Rob.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question