Skip to content

Commit

Permalink
add audio_channels information
Browse files Browse the repository at this point in the history
  • Loading branch information
alucryd committed Nov 26, 2020
1 parent 29d3856 commit ec24e9f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pymkv/MKVTrack.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def __init__(self, file_path, track_id=0, track_name=None, language=None, defaul
# track info
self._track_codec = None
self._track_type = None
self._audio_channels = 0

# base
self.mkvmerge_path = 'mkvmerge'
Expand Down Expand Up @@ -171,6 +172,8 @@ def track_id(self, track_id):
self._track_id = track_id
self._track_codec = info_json['tracks'][track_id]['codec']
self._track_type = info_json['tracks'][track_id]['type']
if self._track_type == 'audio':
self._audio_channels = info_json['tracks'][track_id]['properties']['audio_channels']

@property
def language(self):
Expand Down Expand Up @@ -226,3 +229,8 @@ def track_codec(self):
def track_type(self):
"""str: The type of track such as video or audio."""
return self._track_type

@property
def audio_channels(self):
"""int: The number of audio channels in the track."""
return self._audio_channels

0 comments on commit ec24e9f

Please sign in to comment.