일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- format
- DB
- docker
- KAKAO
- Windows
- Paper
- LLM
- Container
- numpy
- Linux
- Database
- GitLab
- pytorch
- AI
- Python
- judge
- pandas
- git
- Package
- CUDA
- file
- Converting
- list
- Laravel
- Mac
- enV
- PostgreSQL
- TORCH
- evaluation
- Flask
- Today
- Total
목록pcm (2)
Daily Develope
ㅇ 사용 라이브러리 - numpy : pcm파일 로딩 - librosa : pcm파일을 wav형태로 변환 - matplotlib : 파형 출력 ㅇ 코드 import numpy as np import librosa as lr import matplotlib.pyplot as plt ### Load File target = "pcm파일경로" f=open(target, 'rb') buf = bytearray(f.read()) pcm_data = np.frombuffer(buf, dtype = 'int16')# bit 수에 맞게 입력 wav_data = lr.util.buf_to_float(x=pcm_data, n_bytes=2) ### Draw Graph x_axis = [i/8000 if i>0 else i..
PCM 파일 통합(합치기) : PCM은 파일의 시작에 소리 정보를 담고있는 header가 존재하지 않기 때문에, raw 데이터(Byte Code)를 그대로 읽어서 합치면된다. targetList = ["{대상파일1_경로}", "{대상파일2_경로}"] destinationPath = "{생성파일경로}" buf = bytearray() for file in targetList: f = open(file, 'rb') buf += f.read() f.close() wf = open(destinationPath, 'wb') wf.write(buf) wf.close() PCM 에서 WAV 로의 변환 : PCM 데이터를 WAV로 변환하려는 경우 WAV 파일이 어떻게 쓰였는지 나타내는 He..