[AccessD] Embedding a WAV file

A.D.Tejpal adtp at touchtelindia.net
Wed Mar 2 12:48:37 CST 2005


Rocky,

    Sample code given below, pertains to bound OLE control named Drg. Record source for the form is a table having wav sounds stored in this field. CmdSound is the name of command button used for playing the sound pertaining to current record.

    It may please be noted that when the sound clip is played, the focus gets captured by the OLE control.

Best wishes,
A.D.Tejpal
--------------

==============================
Private Sub CmdSound_Click()
On Error Resume Next
    If Drg.OLEType = acOLENone Then
        MsgBox "No Recording"
    Else
        Drg.Action = acOLEActivate
    End If          'Drg
On Error GoTo 0
End Sub
==============================

  ----- Original Message ----- 
  From: Rocky Smolin - Beach Access Software 
  To: Access Developers discussion and problem solving 
  Sent: Wednesday, March 02, 2005 22:55
  Subject: Re: [AccessD] Embedding a WAV file


  Darren:

  When I do the installable run-time I think I can include my WAV file and it 
  will be transparent to the user. For beta testing I need to send them just 
  one file.  So I'm still looking for a way to do this.

  I did insert-->Object-->from file and inserted the wav file in an Unbound 
  Object Frame.  But getting it to play in the On Click events of other 
  controls, like command buttons, is the next problem.  And then, I would 
  probably have to insert this UOF in every form.

  Is there maybe a way of putting it into a field in a table and running it 
  from there so it could be run from any form?

  TIA

  Rocky Smolin
  Beach Access Software
  http://www.e-z-mrp.com
  858-259-4334

  ----- Original Message ----- 
  From: "Darren DICK" <d.dick at uws.edu.au>
  To: "'Access Developers discussion and problem solving'" 
  <accessd at databaseadvisors.com>
  Sent: Tuesday, March 01, 2005 5:18 PM
  Subject: RE: [AccessD] Embedding a WAV file


  > Hi Rocky
  > I have a folder in the App home folder for sounds. Also one for Images and
  > Skins etc
  > EG
  > C:\Program Files\My app will be the 'home' folder
  > And in it will be
  > C:\Program Files\My app\Sounds (About 5 or 6 files in here)
  > C:\Program Files\My app\Images (3 more folders and about 20 files in here)
  > C:\Program Files\My app\Skins (1 folder (but it can grow) and many files 
  > in
  > here)
  >
  > I install them when I install the app.
  > They are my 'standard' folders and files and go with every app.
  > And I refer to them now by heart with lines like
  > (I actually use globals for the length of the session But can be done at a
  > form Sub level just as easy)
  > EG
  > Dim strSkinToUse as String
  > Dim strSkinFolder as String
  > Dim strImagesFolder as String
  >
  > strSkinToUse = Dlookup("[SkinName]","tblOptions")
  > strSkinFolder = Left(CurrentDb.Name, Len(CurrentDb.Name) -
  > Len(Dir(CurrentDb.Name)) - 1) & "\Skins\" & strSkinToUse
  > strImagesFolder= Left(CurrentDb.Name, Len(CurrentDb.Name) -
  > Len(Dir(CurrentDb.Name)) - 1) & "\Images"
  > strSoundsFolder= Left(CurrentDb.Name, Len(CurrentDb.Name) -
  > Len(Dir(CurrentDb.Name)) - 1) & "\Sounds"
  >
  > Then I refer to each skin component like.....('Cause I know 'em off by
  > heart)
  >
  > Me.picture =  strSkinFolder  & "\Background.jpg"
  > Me.imgMyLogo = strImagesFolder & "\OurLogo.jpg"
  >
  > I use the API code "PlaySound" for Playing Sounds
  > Eg
  > Private Sub Form_Load()
  > PlaySound (strSoundsFolder & "\Logon.wav")
  > End sub
  >
  > It works and is pretty simple.
  >
  > HTH
  >
  > See ya
  >
  > Darren




More information about the AccessD mailing list