diff --git a/README.md b/README.md index 87bf5b6..26d0da1 100644 --- a/README.md +++ b/README.md @@ -8,3 +8,20 @@ nextflow run doom > [!NOTE] > All credit for the Java implementation go to this project: https://github.com/gaborbata/vanilla-mocha-doom + +## Troubleshooting + +### Sound error: NullPointerException + +If you see an error like: + +``` +Cannot invoke "javax.sound.midi.Receiver.send(javax.sound.midi.MidiMessage, long)" because "receiver" is null +``` + +This occurs on systems without MIDI audio devices. Run with `--nomusic` to disable music only, or `--nosound` to disable all audio: + +```bash +nextflow run doom --nomusic # Disable music only +nextflow run doom --nosound # Disable all sound +``` diff --git a/main.nf b/main.nf index 679fc86..224b651 100644 --- a/main.nf +++ b/main.nf @@ -1,5 +1,8 @@ #!/usr/bin/env nextflow +params.nomusic = false +params.nosound = false + process printLogo { output: stdout @@ -71,8 +74,9 @@ process playDoom { val true script: + def soundFlags = params.nosound ? '-nosound' : (params.nomusic ? '-nomusic' : '') """ - java -jar $projectDir/lib/mochadoom.jar -iwad $projectDir/doom1.wad + java -jar $projectDir/lib/mochadoom.jar -iwad $projectDir/doom1.wad $soundFlags """ }