Skip to content

Commit

Permalink
fix maybe
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanCheshire committed Jul 1, 2024
1 parent c075b8e commit c0c36ee
Showing 1 changed file with 24 additions and 39 deletions.
63 changes: 24 additions & 39 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,59 +35,26 @@ jobs:
Xvfb :99 -screen 0 1024x768x24 &
sleep 5
export DISPLAY=:99
# Verify PulseAudio setup
pulseaudio --check
pactl list modules
aplay -l
- name: Create and run Java audio test on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
echo 'import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.Clip;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.UnsupportedAudioFileException;
import java.io.File;
import java.io.IOException;
public class AudioTest {
public static void main(String[] args) {
try {
File audioFile = new File("src/test/resources/test.wav");
if (!audioFile.exists()) {
System.out.println("Audio file not found.");
return;
}
AudioInputStream audioStream = AudioSystem.getAudioInputStream(audioFile);
Clip clip = AudioSystem.getClip();
clip.open(audioStream);
System.out.println("Audio system initialized and clip loaded successfully.");
} catch (LineUnavailableException | UnsupportedAudioFileException | IOException e) {
e.printStackTrace();
}
}
}' > AudioTest.java
javac AudioTest.java
java AudioTest
- name: Build with Gradle and run audio setup test on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
./gradlew clean test --tests "com.github.natche.cyderutils.audio.AudioSetupTest" --info --stacktrace --no-daemon
env:
DISPLAY: ":99"

- name: Install BlackHole on macOS
if: matrix.os == 'macos-latest'
run: |
brew install --cask blackhole-2ch
sudo mkdir -p /Library/Audio/Plug-Ins/HAL/BlackHole.driver
sudo cp -R /usr/local/Cellar/blackhole/0.6.0/BlackHole.driver /Library/Audio/Plug-Ins/HAL/
sudo launchctl kickstart -kp system/com.apple.audio.coreaudiod
ls /Library/Audio/Plug-Ins/HAL/
- name: Install Scream on Windows
if: matrix.os == 'windows-latest'
shell: powershell
run: |
choco install ffmpeg python
python -m pip install --upgrade pip
pip install mutagen
Invoke-WebRequest https://github.com/duncanthrax/scream/releases/download/4.0/Scream4.0.zip -OutFile Scream4.0.zip
Expand-Archive -Path Scream4.0.zip -DestinationPath Scream
openssl req -batch -verbose -x509 -newkey rsa -keyout ScreamCertificate.pvk -out ScreamCertificate.cer -nodes -extensions v3_req
Expand All @@ -113,5 +80,23 @@ jobs:
run: net start audiosrv
shell: powershell

- name: Build with Gradle and run audio setup test on Windows
- name: Verify PulseAudio Setup
if: matrix.os == 'ubuntu-latest'
run: |
pulseaudio --check
pactl list modules
aplay -l
- name: Verify BlackHole Setup
if: matrix.os == 'macos-latest'
run: ls /Library/Audio/Plug-Ins/HAL/

- name: Verify Scream Setup
if: matrix.os == 'windows-latest'
run: sc query audiosrv
shell: powershell

- name: Build with Gradle and run audio setup test
run: ./gradlew clean test --tests "com.github.natche.cyderutils.audio.AudioSetupTest" --info --stacktrace --no-daemon
env:
DISPLAY: ":99"

0 comments on commit c0c36ee

Please sign in to comment.