Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default argument to the get_array_of_samples #313

Merged
merged 2 commits into from
Sep 6, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pydub/audio_segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,13 @@ def raw_data(self):
"""
return self._data

def get_array_of_samples(self):
def get_array_of_samples(self, array_type_override=None):
"""
returns the raw_data as an array of samples
"""
return array.array(self.array_type, self._data)
if array_type_override is None:
array_type_override = self.array_type
return array.array(array_type_override, self._data)

@property
def array_type(self):
Expand Down