Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
engine-core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AURA
engine-core
Commits
2d1172d1
Commit
2d1172d1
authored
2 years ago
by
David Trattnig
Browse files
Options
Downloads
Patches
Plain Diff
Test: Retrieve track duration
parent
4798620d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!3
Liquidsoap 2 migration
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_metadata_duration.liq
+42
-0
42 additions, 0 deletions
tests/test_metadata_duration.liq
with
42 additions
and
0 deletions
tests/test_metadata_duration.liq
0 → 100755
+
42
−
0
View file @
2d1172d1
#!/usr/bin/env liquidsoap
#
# Aura Engine (https://gitlab.servus.at/aura/engine)
#
# Copyright (C) 2017-now() - The Aura Engine Team.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
%include "base_config.liq"
settings.frame.audio.samplerate.set(44100)
%include "../src/functions.liq"
# Read duration from file => 808
metadata = [( "track_duration", "808" )]
duration = get_meta_track_duration(metadata)
print("Track duration in meta 'track_duration': #{duration}")
assertEquals(duration, 808)
# Read duration from file => 207
input_fs = single(id="fs", "assets/audio.mp3")
def process(metadata) =
duration = get_meta_track_duration(metadata)
print("Track duration on file: #{duration}")
assertEquals(duration, 207)
shutdown(code=0)
end
input_fs.on_metadata(process)
output.dummy(id="dummy", input_fs)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment