diff --git a/jpro-media/src/main/java/one/jpro/platform/media/recorder/NativeMediaRecorder.java b/jpro-media/src/main/java/one/jpro/platform/media/recorder/NativeMediaRecorder.java index 935cd782..3090540b 100644 --- a/jpro-media/src/main/java/one/jpro/platform/media/recorder/NativeMediaRecorder.java +++ b/jpro-media/src/main/java/one/jpro/platform/media/recorder/NativeMediaRecorder.java @@ -96,7 +96,7 @@ public NativeMediaRecorder() { // Initialize audio frame grabber micGrabber = new FFmpegFrameGrabber(getDefaultAudioInputDevice()); - micGrabber.setFormat("avfoundation"); + micGrabber.setFormat(getDefaultAudioInputFormat()); micGrabber.setAudioChannels(DEFAULT_AUDIO_CHANNELS); micGrabber.setSampleRate(DEFAULT_AUDIO_SAMPLE_RATE); @@ -592,4 +592,41 @@ public static String getDefaultAudioInputDevice() { return audioDevice; } + /** + * Gets the default audio input format based on the operating system. + *
+ * This method determines the appropriate audio input format for use with {@link FFmpegFrameGrabber}, + * based on the operating system where the application is running: + *
+ *