audio stream intro mode
Posted: 10 Jan 2024, 00:56
I am trying to create a script that plays a series of internet audio streams consecutively for 20 sec each.
This is what chatgpt suggested trying with v1.0:
The effect of this script is that it will load the first two consecutively without letting either load and strangely none of the following playlists.
This is what chatgpt suggested trying with v1.0:
Code: Select all
; Open VLC and play each playlist for 20 seconds
; Define the URLs of your playlists
Playlist1 := "http://yourplaylisturl1.com"
Playlist2 := "http://yourplaylisturl2.com"
; Add more playlists as needed
; Set the duration in milliseconds (20 seconds)
Duration := 20000
; Function to open VLC, load a playlist, and play it
OpenAndPlay(Playlist) {
Run, "C:\Program Files\VideoLAN\VLC\vlc.exe" %Playlist% ; Adjust the path to your VLC installation
WinWait, ahk_exe vlc.exe
WinActivate ; Activate VLC window
Sleep, 1000 ; Wait for VLC to load
Send, ^o ; Open playlist
Sleep, 1000 ; Wait for the "Open Media" window
SendInput, %Playlist%{Enter} ; Enter the playlist URL
Sleep, 1000 ; Wait for VLC to load the playlist
Send, p ; Play the current playlist
Sleep, %Duration% ; Wait for the specified duration
Send, s ; Stop playback
Sleep, 1000 ; Give VLC some time to process the stop command
WinClose ; Close VLC
}
; Press F1 to start playing the playlists
F1::
OpenAndPlay(Playlist1)
OpenAndPlay(Playlist2)
; Add more playlists as needed
return