Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import java.util.concurrent.TimeUnit;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;

Expand All @@ -24,14 +23,14 @@ public class RealtimeApiTest {

private static final double LOG_2 = Math.log(2.0);

private static byte[] QUESTION_FIXTURE_PCM;
private static byte[] HELLO_FIXTURE_PCM;

private final OpenAiService service = new OpenAiService();

@BeforeAll
public static void setUp() {
try (var fis = new FileInputStream("src/test/resources/fixtures/question.pcm")) {
QUESTION_FIXTURE_PCM = fis.readAllBytes();
try (var fis = new FileInputStream("src/test/resources/fixtures/hello.pcm")) {
HELLO_FIXTURE_PCM = fis.readAllBytes();
} catch (IOException e) {
fail(e.getMessage());
}
Expand Down Expand Up @@ -74,8 +73,6 @@ void testTextToSpeech() {

@Test
@Timeout(value = 60, unit = TimeUnit.SECONDS)
@Disabled(
"Works locally. Fails in CI. Temporary disabled to suppress noise and unblock release while investigating")
void testSpeechToSpeech() {
var outputBuffer = new ByteArrayOutputStream(600000);
var monitor = new CountDownLatch(1);
Expand All @@ -93,7 +90,7 @@ void testSpeechToSpeech() {
},
RealtimeParamTurnDetection.EACH_CALL_IS_A_TURN,
systemPrompt)) {
input.inputAudio(QUESTION_FIXTURE_PCM);
input.inputAudio(HELLO_FIXTURE_PCM);
completed = monitor.await(55, TimeUnit.SECONDS);
} catch (Exception e) {
if (!(e instanceof InterruptedException)) {
Expand Down
Binary file not shown.
Binary file not shown.