Skip to content

Commit e893ba8

Browse files
committed
more phase options
fix bugs
1 parent 7249563 commit e893ba8

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

audioqc

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,9 @@ class QcTarget
163163
end
164164

165165
if @mediainfo_out['media']['track'][1]['Channels'] == "2"
166-
stereo_count = @mediainfo_out['media']['track'][0]['Encoded_Library_Settings'].scan(/stereo/i).count
167-
dual_count = @mediainfo_out['media']['track'][0]['Encoded_Library_Settings'].scan(/dual/i).count
168-
unless stereo_count + dual_count == signal_chain_count
166+
@stereo_count = @mediainfo_out['media']['track'][0]['Encoded_Library_Settings'].scan(/stereo/i).count
167+
@dual_count = @mediainfo_out['media']['track'][0]['Encoded_Library_Settings'].scan(/dual/i).count
168+
unless @stereo_count + @dual_count == signal_chain_count
169169
@enc_hist_error << "BEXT Coding History channels don't match file"
170170
end
171171
end
@@ -206,11 +206,21 @@ class QcTarget
206206
out_of_phase_frames = []
207207
phase_frames = []
208208
@levels = []
209+
if ! @dual_count.nil? && ! @stereo_count.nil?
210+
if @dual_count > 0
211+
phase_limit = Configurations['dualmono_audio_phase_limit']
212+
elsif
213+
@stereo_count > 1
214+
phase_limit = Configurations['stereo_audio_phase_limit']
215+
end
216+
else
217+
phase_limit = Configurations['generic_audio_phase_limit']
218+
end
209219
@ffprobe_out['frames'].each do |frames|
210220
peaklevel = frames['tags']['lavfi.astats.Overall.Peak_level'].to_f
211221
audiophase = frames['tags']['lavfi.aphasemeter.phase'].to_f
212222
phase_frames << audiophase
213-
out_of_phase_frames << audiophase if audiophase < Configurations['audio_phase_limit']
223+
out_of_phase_frames << audiophase if audiophase < phase_limit
214224
high_db_frames << peaklevel if peaklevel > Configurations['high_level_warning']
215225
@levels << peaklevel
216226
end

audioqc.config

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
# Set QC values here
44

5-
audio_phase_limit: -0.25
5+
stereo_audio_phase_limit: -0.25
6+
dualmono_audio_phase_limit: 0.95
7+
generic_audio_phase_limit: -0.25
68
high_level_warning: -2.0
79
default_extension: 'wav'

0 commit comments

Comments
 (0)