Playing mp3 files

I've used to play mp3 files by code using the MMControl this way:

Sub playMp3(ByVal mp3file$, ByVal wait As Boolean)
mmcMp3.Command = "Close"
mmcMp3.FileName = mp3file$
mmcMp3.Command = "Open"
mmcMp3.Wait = wait
mmcMp3.Command = "Play"
End Sub

Now I want to do the same by getting the sound file from an Access database. I use a data control to pick the sound object from the mdb file, then I display the file in an OLE control, referring to the data control. When I click on the OLE control, the mp3 file is beeing played in the Windows Media Player.

This is not what I want. Is there any way that I can have the data in the OLE control transferred to the MMControl - making me able to play the sound invisible, automatically, by code only?

The way to do it is obviously not to replace the
mmcMp3.FileName = mp3file$
line with something like
mmcMp3.FileName = myOLEobject$ ....
but how?

Is there any other solution? In other words: How to use my sound data in the mdb in a convenient way?


Comments

  • OK. Solved it :)
    Used the getChunk/appendChunk methods instead:
    http://support.microsoft.com/?kbid=210486
    Works fine now.

    : I've used to play mp3 files by code using the MMControl this way:
    :
    : Sub playMp3(ByVal mp3file$, ByVal wait As Boolean)
    : mmcMp3.Command = "Close"
    : mmcMp3.FileName = mp3file$
    : mmcMp3.Command = "Open"
    : mmcMp3.Wait = wait
    : mmcMp3.Command = "Play"
    : End Sub
    :
    : Now I want to do the same by getting the sound file from an Access database. I use a data control to pick the sound object from the mdb file, then I display the file in an OLE control, referring to the data control. When I click on the OLE control, the mp3 file is beeing played in the Windows Media Player.
    :
    : This is not what I want. Is there any way that I can have the data in the OLE control transferred to the MMControl - making me able to play the sound invisible, automatically, by code only?
    :
    : The way to do it is obviously not to replace the
    : mmcMp3.FileName = mp3file$
    : line with something like
    : mmcMp3.FileName = myOLEobject$ ....
    : but how?
    :
    : Is there any other solution? In other words: How to use my sound data in the mdb in a convenient way?
    :
    :
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion