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

Fix imports of AudioSegments in stereo_to_ms and ms_to_stereo #707

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,7 @@ Grzegorz Kotfis
github: gkotfis

Pål Orby
github: orby
github: orby

Ruben D
github: Ghostkeeper
2 changes: 2 additions & 0 deletions pydub/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ def stereo_to_ms(audio_segment):
'''
Left-Right -> Mid-Side
'''
from .audio_segment import AudioSegment
channel = audio_segment.split_to_mono()
channel = [channel[0].overlay(channel[1]), channel[0].overlay(channel[1].invert_phase())]
return AudioSegment.from_mono_audiosegments(channel[0], channel[1])
Expand All @@ -434,6 +435,7 @@ def ms_to_stereo(audio_segment):
'''
Mid-Side -> Left-Right
'''
from .audio_segment import AudioSegment
channel = audio_segment.split_to_mono()
channel = [channel[0].overlay(channel[1]) - 3, channel[0].overlay(channel[1].invert_phase()) - 3]
return AudioSegment.from_mono_audiosegments(channel[0], channel[1])
Expand Down