diff --git a/record-and-playback/core/lib/recordandplayback/edl/audio.rb b/record-and-playback/core/lib/recordandplayback/edl/audio.rb
index db24d0b24fff1f57d1ad488e49d95ce61be8c709..5682fef63a65d4e95ba3da67a14456352b8d7ce1 100644
--- a/record-and-playback/core/lib/recordandplayback/edl/audio.rb
+++ b/record-and-playback/core/lib/recordandplayback/edl/audio.rb
@@ -25,9 +25,9 @@ module BigBlueButton
       FFMPEG_AFORMAT_SCREENSHARE = "aresample=async=1000,aformat=sample_fmts=s16:sample_rates=48000:channel_layouts=stereo"
       FFMPEG_WF_CODEC = 'libvorbis'
       FFMPEG_WF_ARGS = ['-c:a', FFMPEG_WF_CODEC, '-q:a', '2', '-f', 'ogg']
-      WF_EXT = 'ogg'
       FFMPEG_WF_SCREENSHARE_CODEC = 'libopus'
       FFMPEG_WF_SCREENSHARE_ARGS = ['-c:a', FFMPEG_WF_SCREENSHARE_CODEC, '-b:a', '48K', '-f', 'opus']
+      WF_EXT = 'ogg'
 
       def self.dump(edl)
         BigBlueButton.logger.debug "EDL Dump:"
diff --git a/record-and-playback/core/lib/recordandplayback/generators/events.rb b/record-and-playback/core/lib/recordandplayback/generators/events.rb
index 94be3e5e8bbb9c3071c22df78a9675cb47209d89..6dd353a388953389a2683ad2d5d2d72f031abc7f 100755
--- a/record-and-playback/core/lib/recordandplayback/generators/events.rb
+++ b/record-and-playback/core/lib/recordandplayback/generators/events.rb
@@ -693,7 +693,8 @@ module BigBlueButton
     end
 
     # Check if any screenshare files has audio
-    def self.screenshare_has_audio?(events)
+    def self.screenshare_has_audio?(events_xml)
+      events = Nokogiri::XML(File.open(events_xml))
       events.xpath('/recording/event[@eventname="StartWebRTCDesktopShareEvent"]').each do |event|
         filename = event.at_xpath('filename').text
         fileHasAudio = !BigBlueButton::EDL::Audio.audio_info(filename)[:audio].nil?