Ruby gem

Introduction

Is a native ruby code that can read a wav file and it compute is loudness level in LKFS following ITU-R BS.1770.

  You can download the JOCLoudness (Ruby version) from:  Gem Version

Accepted input wave (.wav) formats

 Header type  Sample type  Sample frequencies
 Integer sample bits
 Float sample bits
 16 bytes
18 bytes
40 bytes (WAVEEX)
Integer
Float
 All  8
16
24
 32

Note 1: This module recalculates automatically the filter coefficients depending on input file sampling frequency

Note 2: ITU-R BS.1770 is a NOT gated measure

Usage examples

  • Simple:
require 'JOCLoudness'

wavfilename = "c:\\Test.wav"

begin
  loud = JOCLoudness.new(wavfilename)
  lkfs = loud.CalcLoudness()
  loud.Close()
  puts "Loudness of #{wavfilename} = #{lkfs.round(1)} LKFS"
rescue Exception => e
  puts "Error: #{e.message}, Trace: #{e.backtrace.inspect}"
end

  • Advanced:
require 'JOCLoudness'

wavfilename = ARGV[0]
logfilename = ARGV[1]

begin
  loud = JOCLoudness.new(wavfilename, logfilename, Logger::DEBUG)
  lkfs = loud.CalcLoudness()
  loud.Close()
  puts "Loudness of #{wavfilename} = #{lkfs.round(1)} LKFS"
rescue Exception => e
  puts "Error: #{e.message}, Trace: #{e.backtrace.inspect}"
end

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: