Skip to content

Commit

Permalink
all_Automation_Git_Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
AmolKadam-Tekdi committed Jul 9, 2024
1 parent 76b7730 commit 41e64c5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions allAutomation/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions allAutomation/src/main/java/Tests/AllTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,18 @@ public static void Login() throws Exception {
logStep("Speak text in Mike ");


AudioFormat format = new AudioFormat(16000.0f, 16, 1, true, true);
AudioFormat format = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED,
44100.0f, 16, 2, 4, 44100.0f, false);

// Use a different format info
DataLine.Info info = new DataLine.Info(SourceDataLine.class, format);

// Check if the alternative format is supported
if (!AudioSystem.isLineSupported(info)) {
System.out.println("Line matching " + info + " is not supported.");
// List all supported formats for debugging
System.out.println("Alternative format " + format + " is not supported.");
// Log other supported formats for debugging
System.out.println("Supported formats:");
// Log supported formats for debugging
for (Mixer.Info mixerInfo : AudioSystem.getMixerInfo()) {
System.out.println("Mixer: " + mixerInfo.getName());
try {
Expand All @@ -327,8 +331,8 @@ public static void Login() throws Exception {
}
}
} else {
System.out.println("Line matching " + info + " is supported.");
// Proceed with audio processing using the supported format
// Proceed with using the alternative format
System.out.println("Alternative format " + format + " is supported.");
try (SourceDataLine line = (SourceDataLine) AudioSystem.getLine(info)) {
line.open(format);
line.start();
Expand Down

0 comments on commit 41e64c5

Please sign in to comment.