![]() |
Bridges-Python-3.0.2
3.0.2
Bridges(PythonAPI)
|
This is a class in BRIDGES for multi-channel audio data.
This class contains a list of channels that contain sample data. The samples audio are encoded in 8, 16, 24, or 32 bit integers. All methods use 32 bits when taking and returning samples.
Public Member Functions | |
def | __init__ |
AudioBase constructor. More... | |
def | get_num_channels (self) |
Return the number of channels in this AudioClip. More... | |
def | get_channel |
Get the audio channel at index. More... | |
def | get_sample_rate (self) |
def | get_sample_count (self) |
def | get_sample |
Get the sample at the index of the sample data from a specific channel. More... | |
def | set_sample |
Set the sample at the index of the sample data to value. More... | |
def | get_sample_bits (self) |
Get the number of bits for the samples in this audio clip. More... | |
def | get_sample_bytes (self) |
Get the number of bytes for the samples in this audio clip. More... | |
def | get_data_structure_type (self) |
Get the data structure type. More... | |
def | get_data_structure_representation (self) |
Return a dictionary of the data in this audio file. More... | |
def | display (self) |
Print information about this audio file to the console. More... | |
def | audio_from_json |
Create an AudioClip from a json dictionary created by another AudioClip object. More... | |
Public Attributes | |
sample_count | |
sample_rate | |
sample_bits | |
num_channels | |
framebytes | |
def bridges.audio_clip.AudioClip.__init__ | ( | self, | |
filepath | |||
) |
AudioBase constructor.
(int) sample_count: The total number of samples in this audio object (int) sample_rate: The number of samples in 1 second of audio default cd quality (44100)
def bridges.audio_clip.AudioClip.audio_from_json | ( | json_dict | ) |
def bridges.audio_clip.AudioClip.display | ( | self, | |
None | |||
) |
Print information about this audio file to the console.
def bridges.audio_clip.AudioClip.get_channel | ( | self, | |
index | |||
) |
Get the audio channel at index.
The index should be less than get_num_channels().
(int) index: The index of the channel to get. 0 for front-left, 1 for front-right, etc.
def bridges.audio_clip.AudioClip.get_data_structure_representation | ( | self, | |
dict | |||
) |
Return a dictionary of the data in this audio file.
def bridges.audio_clip.AudioClip.get_data_structure_type | ( | self, | |
str | |||
) |
Get the data structure type.
def bridges.audio_clip.AudioClip.get_num_channels | ( | self, | |
int | |||
) |
Return the number of channels in this AudioClip.
1 for mono, 2 for stereo, etc.
def bridges.audio_clip.AudioClip.get_sample | ( | self, | |
channel | |||
) |
Get the sample at the index of the sample data from a specific channel.
(int) channel: The index of the channel to get. 0 for front-left, 1 for front-right, etc. (int) index: The index of the sample to get. From 0 - get_sample_count()
def bridges.audio_clip.AudioClip.get_sample_bits | ( | self, | |
int | |||
) |
Get the number of bits for the samples in this audio clip.
Will be 8, 16, 24, or 32 bits.
def bridges.audio_clip.AudioClip.get_sample_bytes | ( | self, | |
int | |||
) |
Get the number of bytes for the samples in this audio clip.
Will be 1, 2, 3, or 4 bits.
def bridges.audio_clip.AudioClip.get_sample_count | ( | self, | |
int | |||
) |
def bridges.audio_clip.AudioClip.get_sample_rate | ( | self, | |
int | |||
) |
def bridges.audio_clip.AudioClip.set_sample | ( | self, | |
channel | |||
) |
Set the sample at the index of the sample data to value.
(int) channel: The index of the channel to get. 0 for front-left, 1 for front-right, etc. (int) index: The index of sampledata to set which must be less than get_sample_count() (int) value: The value to set the sample to which must be a valid signed integer with bit length get_sample_bits()
bridges.audio_clip.AudioClip.framebytes |
bridges.audio_clip.AudioClip.num_channels |
bridges.audio_clip.AudioClip.sample_bits |
bridges.audio_clip.AudioClip.sample_count |
bridges.audio_clip.AudioClip.sample_rate |