Skip to content
Snippets Groups Projects
Verified Commit 7a831354 authored by Ole Binder's avatar Ole Binder
Browse files

Test: simplify test case

parent a5fbb2b2
No related branches found
No related tags found
1 merge request!17Yaml configuration file
......@@ -28,18 +28,6 @@ fallback_folder =
playlist(id="fallback_folder", "../audio/fallback", mode="randomize")
fallback_folder = mksafe(fallback_folder)
# Event handlers
def on_metadata_notification(meta) =
print(
"on_metadata - update (TRACK: #{meta['title']}, ON AIR: #{meta['on_air']}"
)
end
def on_track_notification(meta) =
print(
"on_track - update (TRACK: #{meta['title']}, ON AIR: #{meta['on_air']}"
)
end
# Create mixer with one queue
in_queue = request.queue(id="in_queue")
input_queue_0 =
......@@ -49,8 +37,6 @@ stripped_mixer = blank.strip(max_blank=5., mixer)
# Output
main_out = fallback(track_sensitive=false, [stripped_mixer, fallback_folder])
main_out.on_metadata(on_metadata_notification)
main_out.on_track(on_track_notification)
output.jack(id="pcm.aura_engine", mksafe(main_out))
##################################################################################################
......@@ -70,35 +56,16 @@ print(
)
# 3. Wait 5 seconds and activate queue via server commands
def enable_queue() =
def show_mixer() =
print(
"Activate queue"
"Show mixer.inputs"
)
r =
server.execute(
"mixer.select 0 true"
)
r = server.execute("mixer.inputs")
print(r)
r =
server.execute(
"mixer.volume 0 1"
)
print(
"Show all functions::"
)
r = server.execute("help")
print(r)
end
thread.run(delay=5., {enable_queue()})
# 4. Metadata is issued instantly (after the 5 seconds from above):
#
# on_metadata - update (TRACK: Two Pianos), ON AIR: 2022/08/02 12:58:03
# on_track - update (TRACK: Two Pianos), ON AIR: 2022/08/02 12:58:03
# 5.
#
# FAILURE: When ALSA is used as a PulseAudio Plugin.
# Audio from the queue starts playing only approx. 23 seconds later
# This delay of 23 seconds is always the same, no matter when the server commands
# are issued (e.g. 30secs later) nor how many requests are pushed to the queue
#
# SUCCESS: When ALSA is used directly, ensuring any PulseAudio server is shut down.
# Queued audio is played at the same time, as the metadata from 4.) is issued.
\ No newline at end of file
thread.run(delay=5., {show_mixer()})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment