|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 11/5/2009 11:03:57 AM
Posts: 5,
Visits: 13
|
|
Dear all,
After a lot of trial and error, the only solution that works is:
Dim snd as String
Dim MyAppID As String
Rte.DeviceManager.Suspend
snd = "C:/Programme/Windows Media Player/wmplayer.exe G:/E-Prime/Fahrversuch/Fahrversuch/Räumlich_Dynamisch/wma/hlvlhrvr.wma"
MyAppID = Shell(snd,0) 'use 0 instead of 1 hide the wmp
sleep(10000)
Rte.DeviceManager.Resume
which means to suspend all e-prime activities and open the Windows Media Player in the back and play the file in real 5.1 sound.
Other experiences on my way:
soundReturnValue only works with .wav files !!! And this works also with the EP2!
Another useful function is mciSendString and works with all kind of files, among others *.wma. But it did not play the 5.1 quite nice (it mixes up the channels). For more info:
http://www.vbforfree.com/?p=219
This example worked on my machine. It also includes an error check.
Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer
Declare Function mciGetErrorString Lib "winmm.dll" Alias "mciGetErrorStringA" (ByVal dwError As Long, ByVal lpstrBuffer As String, ByVal uLength As Long) As Long
Dim Filename as string 'Will contain our file to play
Dim Answer as Long 'Will store our return value from the mciSendString function.
Dim Answer1 as Long
Dim ErrorString as String * 128 'Will store our return string from the mciGetErrorString function. With a buffer of 128 characters.
Dim ErrorString1 as String * 128
Dim ErrorSuccess as boolean' Will contain True or False if our mciGetErrorString was successful at determining our error returned from the mciSendString function
Dim ErrorSuccess1 as boolean
Dim fileToPlay As String
sleep(3000)
fileToPlay = Chr(34) + ("F:/E-Prime/Fahrversuch/Fahrversuch/Räumlich Dynamisch/wma/hlvlhrvr.wma") + Chr(34)
Answer = mciSendString("open " & fileToPlay & " alias oursong", 0, 0, 0)
Answer1 = mciSendString("play oursong", 0, 0, 0)
ErrorSuccess = mciGetErrorString(Answer,ErrorString,128)
ErrorSuccess1 = mciGetErrorString(Answer1,ErrorString1,128)
c.SetAttrib "Answer", Answer
c.SetAttrib "Answer1", Answer1
c.SetAttrib "ErrorString", ErrorString
c.SetAttrib "ErrorString1", ErrorString1
I guess it could work with all kind of file-types.
Matthias
|
|
|
|