File Coverage

blib/lib/Image/ExifTool/Opus.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             #------------------------------------------------------------------------------
2             # File: Opus.pm
3             #
4             # Description: Read Ogg Opus audio meta information
5             #
6             # Revisions: 2016/07/14 - P. Harvey Created
7             #
8             # References: 1) https://www.opus-codec.org/docs/
9             # 2) https://wiki.xiph.org/OggOpus
10             # 3) https://tools.ietf.org/pdf/rfc7845.pdf
11             #------------------------------------------------------------------------------
12              
13             package Image::ExifTool::Opus;
14              
15 1     1   4429 use strict;
  1         2  
  1         37  
16 1     1   5 use vars qw($VERSION);
  1         1  
  1         120  
17              
18             $VERSION = '1.00';
19              
20             # Opus metadata types
21             %Image::ExifTool::Opus::Main = (
22             NOTES => q{
23             Information extracted from Ogg Opus files. See
24             L for the specification.
25             },
26             'OpusHead' => {
27             Name => 'Header',
28             SubDirectory => { TagTable => 'Image::ExifTool::Opus::Header' },
29             },
30             'OpusTags' => {
31             Name => 'Comments',
32             SubDirectory => { TagTable => 'Image::ExifTool::Vorbis::Comments' },
33             },
34             );
35              
36             %Image::ExifTool::Opus::Header = (
37             PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
38             GROUPS => { 2 => 'Audio' },
39             0 => 'OpusVersion',
40             1 => 'AudioChannels',
41             # 2 => 'PreSkip' (int16u)
42             4 => {
43             Name => 'SampleRate',
44             Format => 'int32u',
45             },
46             8 => {
47             Name => 'OutputGain',
48             Format => 'int16u',
49             ValueConv => '10 ** ($val/5120)',
50             },
51             );
52              
53             1; # end
54              
55             __END__