3 """! @package resources
6 from material
import Material
7 from common.range
import mediaType_range, quality_range
8 from utils.attr
import check_attr_type, check_attr_range, check_time_format, check_duration_format
9 from utils.io
import ENCODING
12 """! Audio is a Material subclass representing an audio recording.
15 """! @brief Constructor.
16 Audio instances are owned by FormRepresentation.
17 @return An Audio instance.
30 """! @brief Destructor.
35 """! @brief Set media type.
36 @param media_type Type to set.
37 @return Audio instance.
39 error_msg =
"Media type value '%s' is not allowed" % media_type.encode(ENCODING)
45 """! @brief Get media type.
46 @return Audio attribute 'mediaType'.
51 """! @brief Set file name.
52 @param file_name Name to set.
53 @return Audio instance.
55 error_msg =
"File name value '%s' is not allowed" % file_name.encode(ENCODING)
61 """! @brief Get file name.
62 @return Audio attribute 'fileName'.
67 """! @brief Set author of the material resource.
68 @param author Author to set.
69 @return Audio instance.
71 error_msg =
"Author value '%s' is not allowed" % author.encode(ENCODING)
77 """! @brief Get author of the material resource.
78 @return Audio attribute 'author'.
83 """! @brief Set audio recording quality.
84 @param quality Quality to set.
85 @return Audio instance.
87 error_msg =
"Quality value '%s' is not allowed" % quality.encode(ENCODING)
93 """! @brief Get audio recording quality.
94 @return Audio attribute 'quality'.
99 """! @brief Set sound.
100 @param sound Sound to set.
101 @return Audio instance.
103 error_msg =
"Sound value '%s' is not allowed" % sound.encode(ENCODING)
109 """! @brief Get sound.
110 @return Audio attribute 'sound'.
115 """! @brief Set transcription of the audio recording.
116 @param Transcription to set.
117 @return Audio instance.
119 error_msg =
"Transcription value '%s' is not allowed" % transcription.encode(ENCODING)
125 """! @brief Get transcription of the audio recording.
126 @return Audio attribute 'transcription'.
131 """! @brief Set start position.
132 @param start_position Start position to set.
133 @return Audio instance.
135 error_msg =
"Start position value '%s' is not allowed" % start_position.encode(ENCODING)
137 if start_position[0] !=
'T':
139 start_position =
'T' + start_position
145 """! @brief Get start position.
146 @return Audio attribute 'startPosition'.
151 """! @brief Set duration of effective speech.
152 @param duration Duration of effective speech to set.
153 @return Audio instance.
155 error_msg =
"Duration of effective speech value '%s' is not allowed" % duration.encode(ENCODING)
157 if duration[0] !=
'P':
158 if duration[0] !=
'T':
160 duration =
'T' + duration
162 duration =
'P' + duration
168 """! @brief Get duration of effective speech.
169 @return Audio attribute 'durationOfEffectiveSpeech'.
174 """! @brief Set external reference.
175 @param external_reference External reference to set.
176 @return Audio instance.
178 error_msg =
"External reference value '%s' is not allowed" % external_reference.encode(ENCODING)
184 """! @brief Get external reference.
185 @return Audio attribute 'externalReference'.
190 """! @brief Set audio file format.
191 @param audio_file_format Audio file format to set.
192 @return Audio instance.
194 error_msg =
"Audio file format value '%s' is not allowed" % audio_file_format.encode(ENCODING)
200 """! @brief Get audio file formay.
201 @return Audio attribute 'audioFileFormat'.
def get_externalReference
Get external reference.
def check_attr_type
Check that attribute value is of specified type.
def get_mediaType
Get media type.
def set_externalReference
Set external reference.
def get_durationOfEffectiveSpeech
Get duration of effective speech.
def set_mediaType
Set media type.
def check_attr_range
Check that attribute value is in specified range.
def set_fileName
Set file name.
def check_time_format
Verify that time format is composed as follows: THH:MM:SS,MSMS (ISO 8601: 'T' for Time)...
durationOfEffectiveSpeech
def set_transcription
Set transcription of the audio recording.
def get_author
Get author of the material resource.
def set_audioFileFormat
Set audio file format.
def get_fileName
Get file name.
def get_quality
Get audio recording quality.
def check_duration_format
Verify that duration format is composed as follows: PTxxHxxMxxS (ISO 8601: 'P' for Period)...
def get_startPosition
Get start position.
def get_transcription
Get transcription of the audio recording.
def set_durationOfEffectiveSpeech
Set duration of effective speech.
def set_author
Set author of the material resource.
def get_audioFileFormat
Get audio file formay.
def set_quality
Set audio recording quality.
Audio is a Material subclass representing an audio recording.
def set_startPosition
Set start position.