- Offizieller Beitrag
Ich bin schon seit Stunden damit beschäftigt, zu versuchen eine MP3-Datei auf einem 5.1 Soundsystem auszugeben.
Irgendwas übersehe ich wahrscheinlich dabei. Hier mal mein Testscript:
Spoiler anzeigen
#AutoIt3Wrapper_UseX64=n
;~ #include <Array.au3>
#include 'Bass.au3'
OnAutoItExitRegister('_Exit')
HotKeySet('{ESC}', '_Exit')
; BASS starten
_BASS_Startup(@ScriptDir & '\bass.dll')
; Deviceliste anzeigen
Global $iIndex = 0, $sDevices = '', $aInfo = '', $error = 0
Do
$iIndex += 1
$aInfo = _BASS_GetDeviceInfo($iIndex)
If IsArray($aInfo) Then $sDevices &= '[' & $iIndex & '] ' & $aInfo[0] & @CRLF
Until $aInfo = 0
MsgBox(0, 'Devicelist', $sDevices)
; Device auswählen
$idDevice = Int(InputBox('Choose Device', 'Enter Device Id', '1'))
If $idDevice >= $iIndex Or @error Then Exit MsgBox(16, 'Wrong Device', 'Device does not exist!')
; Device initialisieren
If Not _BASS_Init(0, $idDevice, 44100, '', 0) Then Exit MsgBox(16, 'Device error', 'Device could not be initialized.')
;~ $aInfo = _BASS_GetInfo()
;~ _ArrayDisplay($aInfo)
;~ _Exit()
; Audiodatei laden
$sMP3File = FileOpenDialog('Bitte MP3-Datei auswählen', '', 'MP3s (*.mp3)')
If Not FileExists($sMP3File) Then Exit MsgBox(16, 'Datei nicht gefunden!', $sMP3File)
; Stream erstellen
$hStream = _BASS_StreamCreateFile(0, $sMP3File, 0, 0, $BASS_STREAM_AUTOFREE + $BASS_SPEAKER_REAR) ; $BASS_SPEAKER_FRONT oder $BASS_SPEAKER_REAR
; Stream abspielen
_BASS_ChannelPlay($hStream, 1)
$iSongLenght = _BASS_ChannelGetLength($hStream, $BASS_POS_BYTE)
$iSongSeconds = Int(_BASS_ChannelBytes2Seconds($hStream, $iSongLenght))
Do
$iPos = _BASS_ChannelGetPosition($hStream, $BASS_POS_BYTE)
$iSeconds = Int(_BASS_ChannelBytes2Seconds($hStream, $iPos))
ToolTip($iSeconds & ' / ' & $iSongSeconds)
Sleep(500)
Until $iSeconds >= $iSongSeconds
_Exit()
Func _Exit()
; Bass freigeben
_BASS_Free()
Exit
EndFunc ;==>_Exit
Die Infos von _BASS_GetInfo() sehen so aus:
Spoiler anzeigen
[12] = 6 es werden also 6 Lautsprecher erkannt.
Ich habs auch schon versucht mit:
[autoit]_BASS_SetConfig($BASS_CONFIG_3DALGORITHM, $BASS_3DALG_DEFAULT)
[/autoit]
aber das alles hilft nichts. Die MP3-Datei wird immer nur über die Front- oder die Rear-Lautsprecher ausgegeben.
Ich möchte aber gern eine Ausgabe auf allen Lautsprechern. Jemand eine Idee?