diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3dd2cbb..c42e85b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/test/actions-test1.py b/test/actions-test1.py index e785746..0511b5f 100644 --- a/test/actions-test1.py +++ b/test/actions-test1.py @@ -1,5 +1,6 @@ import ctcsound7 as ct import argparse +import os parser = argparse.ArgumentParser() parser.add_argument('-o', '--outfile', default='test.wav') @@ -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