Page 1 of 2 12 LastLast
Results 1 to 15 of 28
  1. #1
    Jaap's Avatar
    Jaap is offline Advanced Beginner
    Windows 11 Access 2021
    Join Date
    Apr 2017
    Location
    North Holland
    Posts
    64

    Placing mp3 file in text box

    Dear Forum, I would like to know how I can play a self-made, short mp3 sound file in a text box when the text box is clicked.
    I have heard that you first have to put something in Module, and then in VBA.
    Can you help me, please?



    Click image for larger version. 

Name:	When enter, want to place short mp3 sound file.png 
Views:	38 
Size:	17.7 KB 
ID:	52214

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2021
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    A google search retuned this: how to play mp3 direct from database | Access World Forums (access-programmers.co.uk)
    plus a host of YouTube videos.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,879
    Not sure what your end game is with the mp3 but if you just want to tell the user something , a simpler option may be using the speech api.

    Mike Wolfe has example code here... https://nolongerset.com/speak/
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  4. #4
    Jaap's Avatar
    Jaap is offline Advanced Beginner
    Windows 11 Access 2021
    Join Date
    Apr 2017
    Location
    North Holland
    Posts
    64
    Thank you all,

    To use Speech you need to open 'Microsoft Speech Object Library', which is located in C:\Windows\System32\Speech\Common\It contains 'sapi.dll' file, but I don't know how to open this Reference - Translator with 'sapi.dll'
    I hope you can help me?

    Click image for larger version. 

Name:	Microsoft Speech Object Library.png 
Views:	30 
Size:	110.8 KB 
ID:	52217

  5. #5
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,879
    You don't open it, you just set a reference to it by checking the box and clicking ok.
    That allows you to use "Early Binding" as colin does in his app your showing.

    Mike's version is using "late binding" where you do not need to set the reference but you lose being able to use intellisense with the object.

    https://learn.microsoft.com/en-us/do...-late-binding/
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  6. #6
    Jaap's Avatar
    Jaap is offline Advanced Beginner
    Windows 11 Access 2021
    Join Date
    Apr 2017
    Location
    North Holland
    Posts
    64
    Thank you, I would like to open 'api.dll', but with which app?
    Notepad does not work?

  7. #7
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,180
    you can open dll files with visual studio, you can load the community version for free

  8. #8
    Jaap's Avatar
    Jaap is offline Advanced Beginner
    Windows 11 Access 2021
    Join Date
    Apr 2017
    Location
    North Holland
    Posts
    64
    Dear NoellaG, Visual Studio is installed, thank you,

    Could you please give me some pointers on how to open C:\Windows\System32\Speech\Common\sapi.dll?

    Click image for larger version. 

Name:	Visual Studio Sept-19-2024.jpg 
Views:	20 
Size:	103.7 KB 
ID:	52221

  9. #9
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,180
    Looking at the screen, you're still installing the program. Once installed you can use file -> open-> file or project

  10. #10
    Jaap's Avatar
    Jaap is offline Advanced Beginner
    Windows 11 Access 2021
    Join Date
    Apr 2017
    Location
    North Holland
    Posts
    64
    Well, I hope this is ok?
    I can't open sapi.dll with this menu...

    Click image for larger version. 

Name:	Visual Studio Menu.png 
Views:	17 
Size:	40.0 KB 
ID:	52222

  11. #11
    Jaap's Avatar
    Jaap is offline Advanced Beginner
    Windows 11 Access 2021
    Join Date
    Apr 2017
    Location
    North Holland
    Posts
    64
    New Install, is this a good menu, please?

    Click image for larger version. 

Name:	New Install.png 
Views:	19 
Size:	80.5 KB 
ID:	52224

  12. #12
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    Just what do you expect to do when you open this dll?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  13. #13
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,180

  14. #14
    Edgar is offline Competent Performer
    Windows 8 Access 2016
    Join Date
    Dec 2022
    Posts
    309
    Add a Windows Media Player control from the ActiveX list, add to the click event of your textbox this:
    Me.WindowsMediaPlayer0.Object.Url = "C:/Path/To/Sound.mp3"

    > WindowsMediaPlayer0 is the name of the control, modify as required
    > "C:/Path/To/Sound.mp3" is the path to your mp3 file, modify as required
    Please click on the ⭐ below if this post helped you.


  15. #15
    Jaap's Avatar
    Jaap is offline Advanced Beginner
    Windows 11 Access 2021
    Join Date
    Apr 2017
    Location
    North Holland
    Posts
    64
    Just what do you expect to do when you open this dll?

    This is what I did, like you told me: File, Open, then found api.dll Open, but only Edit was possible, not Open api.dll

    Click image for larger version. 

Name:	Warning.png 
Views:	14 
Size:	31.9 KB 
ID:	52227

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 03-10-2021, 10:01 PM
  2. Writing to a text file and linking table to text file
    By NightWalker in forum Programming
    Replies: 17
    Last Post: 07-21-2020, 04:35 PM
  3. Replies: 4
    Last Post: 05-26-2018, 03:02 PM
  4. Replies: 4
    Last Post: 09-09-2015, 12:10 PM
  5. VBA Opening Excel File and Placing Data in Cells
    By BobTHG in forum Programming
    Replies: 0
    Last Post: 01-13-2008, 03:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums