Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gesellkammer committed Nov 23, 2024
1 parent d099dc0 commit 91b81c2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ jobs:
- name: test
run: |
cd test
python actions-test1.py -o actions-test1-${{ runner.os }}-${{ matrix.csound-branch }}.wav
python actions-test1.py -o actions-test1-${{ runner.os }}-${{ matrix.csound-branch }}.flac
#- uses: actions/upload-artifact@v3
# with:
# path: test/*.wav
- uses: actions/upload-artifact@v3
with:
path: test/*.flac
12 changes: 12 additions & 0 deletions test/actions-test1.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ctcsound7 as ct
import argparse
import os

parser = argparse.ArgumentParser()
parser.add_argument('-o', '--outfile', default='test.wav')
Expand All @@ -9,6 +10,17 @@
cs = ct.Csound()

cs.setOption(f"-o{args.outfile}")
ext = os.path.splitext(args.outfile)[1]
if ext == '.flac':
cs.setOption("--format=flac")
elif ext == '.mp3':
cs.setOption("--mpeg")
elif ext == '.ogg':
cs.setOption("--format=ogg")
cs.setOption("--format=vorbis")
else:
assert ext == '.wav'

cs.compileOrc(r'''
0dbfs = 1
ksmps = 64
Expand Down

0 comments on commit 91b81c2

Please sign in to comment.