(self)
| 26 | """ |
| 27 | |
| 28 | def setUp(self): |
| 29 | soundfont = os.getenv("SOUNDFONT") |
| 30 | if soundfont is None: |
| 31 | raise ValueError( |
| 32 | "A soundfont (*.sf2) file path must be provided in the SOUNDFONT environment variable" |
| 33 | ) |
| 34 | |
| 35 | self.tempdir = tempfile.mkdtemp() |
| 36 | output_file = os.path.join(self.tempdir, "test.wav") |
| 37 | |
| 38 | fluidsynth.init(soundfont, file=output_file) |
| 39 | fluidsynth.set_instrument(0, 0) |
| 40 | s = SequencerObserver() |
| 41 | fluidsynth.midi.attach(s) |
| 42 | |
| 43 | def tearDown(self): |
| 44 | shutil.rmtree(self.tempdir) |
nothing calls this directly
no test coverage detected