Python
Audioop:: Manipulate raw audio data
#Ubuntu 16.04 LTS
#Python 3.5.2
#>> 상세 설명, 실행화면
audioop
The audioop module contains some useful operations on sound fragments. It operates on sound fragments consisting of signed integer samples 8, 16 or 32 bits wide, stored in Python strings. This is the same format as used by the al and sunaudiodev modules. All scalar items are integers, unless specified otherwise.
This module provides support for a-LAW, u-LAW and Intel/DVI ADPCM encodings.
A few of the more complicated operations only take 16-bit samples, otherwise, the sample size (in bytes) is always a parameter of the operation.
사용방법
import audioop
def stereo_to_mono(data, width=2):
lsample = audioop.tomono(data, width, 1, 0)
rsample = audioop.tomono(data, width, 0, 1)
return audioop.add(lsample, rsample, width)
def mono_to_stereo(data, width=1):
lsample = audioop.tostereo(data, width, 1, 0)
rsample = audioop.tostereo(data, width, 0, 1)
return audioop.add(lsample, rsample, width)
#2018년07월17일
'개발자 레니는 지금 - > 소프트웨어와 함께' 카테고리의 다른 글
[ Module ] Struct, c 구조체 호환 (0) | 2018.09.10 |
---|---|
[ C/C++ ] Type bool (0) | 2018.09.07 |
[ BASIC ] 발생자 제네레이터 (0) | 2018.07.16 |
[ BASIC ] 반복자 이터레이터 (0) | 2018.07.16 |
[ MODULE ] boto3:: aws api (0) | 2018.07.16 |