hey, ich bin gerade dabei etwas mit der Bass UDF zu experimentieren und wollte wissen wie man es macht, dass
man mehrere Sounddatein in einem Steam hat
also so in der art eine Playlist die er runter spielt
oder muss man das alles einzelnd machen?
ich habe schon ein bischen gemacht und dabei kahm das raus:
Spoiler anzeigen
#include <Bass.au3>
#include <BassConstants.au3>
OnAutoItExitRegister("OnAutoItExit")
HotKeySet("{F1}", "_EventX")
HotKeySet("{F2}", "_EventY")
_BASS_STARTUP()
_BASS_Init(0, -1, 44100, 0, "")
Dim $SoundChannel[3][3]
$steam = 1
$SoundChannel[0][0] = 1
$SoundChannel[0][1] = _BASS_StreamCreateFile(False, @ScriptDir & "\sound\8.ogg", 0, 0, 0)
$SoundChannel[0][2] = _BASS_StreamCreateFile(False, @ScriptDir & "\sound\9.ogg", 0, 0, 0)
$SoundChannel[2][0] = 1
$SoundChannel[2][1] = _BASS_StreamCreateFile(False, @ScriptDir & "\sound\19.ogg", 0, 0, 0)
$SoundChannel[2][2] = _BASS_StreamCreateFile(False, @ScriptDir & "\sound\20.ogg", 0, 0, 0)
$SoundChannel[1][0] = _BASS_StreamCreateFile(False, @ScriptDir & "\sound\252.ogg", 0, 0, 0)
[/autoit] [autoit][/autoit] [autoit]_BASS_ChannelPlay($SoundChannel[0][1], 1)
[/autoit] [autoit][/autoit] [autoit]While 1
Sleep(200)
_ControllMusic_Channel_1()
_ControllMusic_Channel_2()
WEnd
Func _ControllMusic_Channel_1()
If $steam <> 1 Then Return -1
If $SoundChannel[0][0] = 1 Then
If _BASS_ChannelIsActive($SoundChannel[0][1]) = $BASS_ACTIVE_STOPPED Then
_BASS_ChannelPlay($SoundChannel[0][2], 1)
$SoundChannel[0][0] = 2
EndIf
ElseIf $SoundChannel[0][0] = 2 Then
If _BASS_ChannelIsActive($SoundChannel[0][2]) = $BASS_ACTIVE_STOPPED Then
_BASS_ChannelPlay($SoundChannel[0][1], 1)
$SoundChannel[0][0] = 1
EndIf
EndIf
EndFunc
Func _ControllMusic_Channel_2()
If $steam <> 2 Then Return -1
If $SoundChannel[2][0] = 1 Then
If _BASS_ChannelIsActive($SoundChannel[2][1]) = $BASS_ACTIVE_STOPPED Then
_BASS_ChannelPlay($SoundChannel[2][2], 1)
$SoundChannel[2][0] = 2
EndIf
ElseIf $SoundChannel[2][0] = 2 Then
If _BASS_ChannelIsActive($SoundChannel[2][2]) = $BASS_ACTIVE_STOPPED Then
_BASS_ChannelPlay($SoundChannel[2][1], 1)
$SoundChannel[2][0] = 1
EndIf
EndIf
EndFunc
Func _EventY()
If $steam = 1 Then
_BASS_ChannelPause($SoundChannel[0][$SoundChannel[0][0]])
_BASS_ChannelPlay($SoundChannel[2][$SoundChannel[2][0]], 0)
$steam = 2
Return 2
ElseIf $steam = 2 Then
_BASS_ChannelPause($SoundChannel[2][$SoundChannel[2][0]])
_BASS_ChannelPlay($SoundChannel[0][$SoundChannel[0][0]], 0)
$steam = 1
Return 1
EndIf
EndFunc
Func _EventX()
_BASS_ChannelPlay($SoundChannel[1][0], 1)
EndFunc
Func OnAutoItExit()
_BASS_Free()
EndFunc ;==>OnAutoItExit
wenn man F1 drückt spielt er nebenbei eine kleine Suunddatei ab, bei F2 wechselt er von Playlist 1 zu 2
und andersrum
aber die frage ist halt: kann man eine art Playlist machen?