View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default How run mp3 audio files in vba

No idea. Change your windows default or google

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"franco2808" wrote in message
...
Dear Don Guillet,
I have worked on your idea but I have this problem.
Windows media player is run and the sound files are not correctlely
sequenced. Sometimes only the first is run, sometimes only the second.
I tried from media player to directly run a playlist and there are strange
behaviour (e.g. a file is played twice and another is not played). So I
tried
VLC instead of Media player and the playlist work well. At this point I
changed method: instead of sequencieng audio file I composed in vba a play
list and run this playlist.
But, also if I set the defaultr application for m3u is VLC, Media player
is
launched and so the file are not well sequenced. Do you know a way to
specify
I want to run VLC and not media player?

"Don Guillett" wrote:

If you don't want to use my idea then

Sub playsongsinarray()
myarray = Array("C:\A_D\Townes Van Zandt- Racing In The Street.mp3",
"C:\A_D\Townes Van Zandt - When He Offers His Hand.mp3")
For Each song In myarray
'MsgBox song
ActiveWorkbook.FollowHyperlink Address:=song
Next song
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"franco2808" wrote in message
...
I wrote this sub:
Sub pippo()
Dim fileaudio As String

fileaudio = "C:\audiomumbay\prova1.mp3"
ActiveWorkbook.FollowHyperlink Address:=fileaudio
fileaudio = "C:\audiomumbay\prova2.mp3"
ActiveWorkbook.FollowHyperlink Address:=fileaudio

End Sub

and what I get is that just the first file is played or sometimes only
the
second is played.
By the way: the Media player windows is shown and I have to close it
manually. Is it possible to avoid the visualization of that window.

"Don Guillett" wrote:

Assuming you have the FULL path and name typed into cells. Simply
select
the
cells desired and fire it.

Sub playselectedfiles()
For Each song In Selection
'MsgBox song
'ActiveWorkbook.FollowHyperlink Address:=FullFileName
ActiveWorkbook.FollowHyperlink Address:=song
Next song
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"franco2808" wrote in message
...
May I take advantage of your kindness?
I have to link more audio files and so I want they to be played one
after
another.
How can I wait for the end of an audio file playing?

"Don Guillett" wrote:

glad to help

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"franco2808" wrote in
message
...
Wonderful. You are great.
Now it works well.
Thank you very much, Don Guillett.

"Don Guillett" wrote:


I just tested fine
fileaudio = "C:/audiomumbay/prova.mp3"
try change to
fileaudio = "C:\audiomumbay\prova.mp3"


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"franco2808" wrote in
message
...
Thanks very much Don Guillett for your help, but I need more
help.
I tried this macro:

Sub pippo()
Dim fileaudio As String

fileaudio = "C:/audiomumbay/prova.mp3"
ActiveWorkbook.FollowHyperlink Address:=fileaudio

End Sub

and it does not work.

If I change the type of file:

Sub pippo()
Dim fileaudio As String

fileaudio = "C:/audiomumbay/prova.wav"
ActiveWorkbook.FollowHyperlink Address:=fileaudio

End Sub

of course with a wav file, it works well.
Maybe I have problems because I have Excel 2000?

"Don Guillett" wrote:

Put this in a double_cllick macro where you doubleclick on
the
typed
in
PATH
and name of the file
C:\A_D\TownesVanZandt\Townes Van Zandt - Drunken
rahayes.mp3


ActiveWorkbook.FollowHyperlink Address:=FullFileName

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"franco2808" wrote in
message
...
In office, eg excel, you can write a macro to run wav audio
files.
Can
you
do
the same for mp3 files?