A.D.Tejpal
adtp at touchtelindia.net
Wed Mar 2 22:48:43 CST 2005
Rocky, Playing a wave sound through OLE control does not cause any intrusion by way of invoking a music player (like Real or Windows Media Player). Just try it. Absolutely normal except for the focus going to OLE control. If you are keen to try the API alternative, a way will have to be found to extract the sound clip from OLE object and place it in a suitable folder. This takes us back to square one, i.e. the wav files could as well have been stored in a special folder - to start with. Practical demonstration of playing a wav file using API call, after searching for it (if available in the target folder), is covered in my sample db named AppointmentsAlert, available at Rogers Access Library (other developers library). Link - http://www.rogersaccesslibrary.com Best wishes, A.D.Tejpal -------------- ----- Original Message ----- From: Rocky Smolin - Beach Access Software To: Access Developers discussion and problem solving Sent: Thursday, March 03, 2005 01:02 Subject: Re: [AccessD] Embedding a WAV file A.D: Well that does work, but instead of playing it straight through the speakers like the function: Declare Function sndPlaySound Lib "winmm.dll" Alias "PlaySoundA" _ (ByVal IpszName As String, ByVal hModule As Long, _ ByVal dwFLags As Long) As Long does, it invokes a player - in my case RealPlayer. Do you know of a way to use the function with an embedded wav file? MTIA, Rocky Smolin Beach Access Software http://www.e-z-mrp.com 858-259-4334 ----- Original Message ----- From: "A.D.Tejpal" <adtp at touchtelindia.net> To: "Access Developers discussion and problem solving" <accessd at databaseadvisors.com> Sent: Wednesday, March 02, 2005 10:48 AM Subject: Re: [AccessD] Embedding a WAV file 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