http://keunwoochoi.blogspot.com/2016/03/2.html

 

음성/음악신호+머신러닝 초심자를 위한 가이드 [2편]

최근우 연구 관련 블로그.

keunwoochoi.blogspot.com

 

 

http://blog.naver.com/PostView.nhn?blogId=mylogic&logNo=220988857132&redirect=Dlog&widgetTypeCall=true

 

Mel Frequency Cepstral Coefficient (MFCC) 란 무엇인가? - 음성 인식 알고리즘

MFCC !! 음성 인식에서 가장 널리 사용되는 알고리즘!! 음성 인식을 위하여 가장 먼저 해야할 것은입력...

blog.naver.com

 

https://buildmedia.readthedocs.org/media/pdf/aubio/latest/aubio.pdf

불러오는 중입니다...

 

이제 빌드가 되었으니 실제 pitch 변환 실습을 해보자! 

 

 

 

우선, Rubberband-program은 음성에 다양한 변조를 가능케 한다! 

pitch shift와 frequency 값을 올리고 내릴 수도 있다....!!

그 외 여러가지 기능들이 있는데, 아직 파악 중이다...

 

 

일단, 기본적으로 Rubberband-program은 

 

Usage: rubberband-program.exe [options] <infile.wav> <outfile.wav

 

로 동작한다.

 

 

 

inputfile : 변조할 음성 파일

outputfile : 산출될 음성 파일

options : -t, -T, ... -p ( --pitch ), -f (--frequency) ,...

 

 

다양한 options 기능!

 

option의 여러 기능 중에서도 pitch와 frequency 변환 실습을 진행해볼 것이다. 

 

 

먼저 적당한 샘플을 구해보자! 

 

 

 

 

https://breakfastquay.com/rubberband/code-doc/classRubberBand_1_1RubberBandStretcher.html

 

Rubber Band Library: RubberBand::RubberBandStretcher Class Reference

#include enum  Option {   OptionProcessOffline = 0x00000000, OptionProcessRealTime = 0x00000001, OptionStretchElastic = 0x00000000, OptionStretchPrecise = 0x00000010,   OptionTransientsCrisp = 0x00000000, OptionTransientsMixed = 0x00000100, OptionTransient

breakfastquay.com

 

 

(1) 환경 setting

 

 

필자는 Rubberband library를 사용하여 pitch 변조 실습을 해보았다. 

 

https://breakfastquay.com/rubberband/

 

Rubber Band Audio Time Stretcher Library

 

breakfastquay.com

 

 

 

[참고] https://superpowered.com/free-open-source-time-stretching-pitch-shifting

 

 

 

 

음성 변조 실습을 해보고 싶어서 찾아보니까 Rubber Band library가

오디오를 편집하고 다루기에 꽤 괜찮을 것 같아서 선택함!  

 

 

 

 

 

 

 

1. RubberBand Library 다운 

 

 

https://breakfastquay.com/rubberband/index.html

 

Rubber Band Audio Time Stretcher Library

 

breakfastquay.com

 

일단, RubberBand library를 사용한 pitch 변조 프로그램은 위의 사이트에서 소스코드를 다운받고, 빌드해주면 됨! 

 

하지만 빌드 시 오류가 나는데,

바로 sndfile.h 헤더 파일을 인식하지 못하는 오류가 나타남! 

그럼 sndfile.h 헤더 파일의 정체는?!

찾아보니까 음성 샘플들을 read & write 해주는 C언어 library임! 

 

< 참고 : Rubber Band Library 설명 >

https://breakfastquay.com/rubberband/code-doc/classRubberBand_1_1RubberBandStretcher.html

 

 

 

 

 

 

 

 

 

2. libsndfile 라이브러리 설치

 

 

http://www.mega-nerd.com/libsndfile/

 

libsndfile

nonpayments.bestowals --> displeases --> History -+- Features -+- Similar or Related Projects -+- News Development -+- Programming Interface -+- Bug Reporting -+- Download FAQ -+- Mailing Lists -+- Change Log -+- Licensing Information -+- See Also Libsndfi

www.mega-nerd.com

 

해당 사이트에서 libsndfile-1.0.28~.tar.gz 뭐시기 파일을 다운받고, 압축해제 시켜주면 됨

 

 

< 참고 : Libsndfile 의 함수 기능에 대한 설명 >

http://www.mega-nerd.com/libsndfile/api.html 

 

The libsndfile API

libsndfile Libsndfile is a library designed to allow the reading and writing of many different sampled sound file formats (such as MS Windows WAV and the Apple/SGI AIFF format) through one standard library interface. plazas --> During read and write operat

www.mega-nerd.com

 

 

 

 

 

 

 

 

 

3. 라이브러리, dll 경로 설정 해주기!

 

Rubberband 프로그램을 빌드하기 전에

sndfile 라이브러리의 헤더 파일과 dll 파일들의 경로를 설정해준다!

 

3-1. 헤더 파일 경로 설정 

 

 

3-2. dll 파일 경로 설정

 

 

 

< 참고 >

해당 블로그를 참고하면, 더 자세한 경로 설정 방법을 확인할 수 있다. 

https://elifelog.tistory.com/476

 

libsndfile.dll 파일 다운로드 및 오류 해결 방법

마이크로소프트 비주얼 스튜디오 닷넷의 비주얼 C++ 이나 비주얼 C 런타임의 라이브러리 파일 중 libsndfile.dll 동적 라이브러리 파일은 오디오 파일을 읽고 쓰기 위한 라이브러리 파일(A library for reading an..

elifelog.tistory.com

 

 

 

 

 

 

 

 

 

4. Rubberband program 빌드

 

빌드에 성공함을 확인할 수 있다.!

그치만 문제가 생겼다... 

 

rubberband-program을 실행시키면,

예상치 못한 libsndfile-1.dll 파일이 존재하지 않다는 오류가 뜬다..

분명, 빌드에 성공했는데도.. 도무지 실행이 되지 않는다.

 

찾아본 결과!

C:\Windows\System32 경로에 해당 dll 파일을 넣어주어야 한다. 

 

 

 

 

 

 

 

 

 

 

5. Rubberband Program 실행 

 

rubberband-program.exe -h 입력해보았더니 잘 실행됨을 볼 수 있다!

이제 음성변조 실습을 할 수 있다... 

 

오픈소스를 다운받고, 라이브러리 설정도 다 해주고, 빌드도 성공했는데, 실행시켰더니 libsndfile-1.dll 파일이 없다고 오류가 뜸! 

 

내가 라이브러리 설정을 잘 해줬는지 다시 봐도 진짜 아무리봐도 문제가 없었음! 

 

C:\Windows\System32 이 경로에 <- libsndfile-1.dll 넣어줬더니 바로 해결됨!!!!! 

 

ㅠㅠㅠㅠ 얼른 개발해야 되는데 이걸로 시간 너무 까먹음 ㅠ... 흑 ㅠㅠ

+ Recent posts