# Show GN: vibra, C++ 노래 인식 서비스 Shazam 클라이언트

> Clean Markdown view of GeekNews topic #13081. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=13081](https://news.hada.io/topic?id=13081)
- GeekNews Markdown: [https://news.hada.io/topic/13081.md](https://news.hada.io/topic/13081.md)
- Type: show
- Author: [fcbayernmuller](https://news.hada.io/@fcbayernmuller)
- Published: 2024-01-29T10:07:13+09:00
- Updated: 2024-01-29T10:07:13+09:00
- Original source: [github.com/BayernMuller](https://github.com/BayernMuller/vibra)
- Points: 5
- Comments: 5

## Topic Body

##### vibra  
  
* 노래 인식 서비스인 Shazam 의 서버와 통신하는 클라이언트를 C++ 로 구현한 프로젝트입니다.  
* 기존 rust 오픈소스 Shazam 클라이언트 [songrec](https://github.com/marin-m/SongRec/tree/master) 보다 2배 가량 빠르게 작동합니다.  
* wav 파일을 읽어와 해당 파일이 어떤 곡인지 데이터를 불러올 수 있습니다.  
* stdin 으로 raw PCM data 를 넣는 방법으로 마이크로 녹음중인 노래도 인식이 가능합니다.  
* fingerprinting 에 필요한 libfftw3, Shazam 서버와 통신에 필요한 libcurl 이 필요합니다.  
* wav file downsampling, channel convert 등의 PCM 데이터를 효율적으로 수행하기 때문에 빠릅니다.  
* 의존성 라이브러리가 적고 빌드가 쉬워 임베디드 기기에 활용할 수 있습니다.

## Comments



### Comment 22651

- Author: mdisprgm
- Created: 2024-01-29T21:12:24+09:00
- Points: 1

rust대신c++을 선택하신 이유가 있나여?

### Comment 22645

- Author: cosine20
- Created: 2024-01-29T15:46:42+09:00
- Points: 1

공유 감사합니다! 성능 개선을 어떻게 하셨는지 개인적으로 궁금하네요.   
라즈베리파이4에서 1초 안팎의 시간이 걸리면 정말 실용적인 성능이네요.

### Comment 22646

- Author: fcbayernmuller
- Created: 2024-01-29T15:52:30+09:00
- Points: 1
- Parent comment: 22645
- Depth: 1

사실 Rust Songrec 이 너무 비효율적이었던것이, 입력 받은 PCM data 에 대해 downsampling, mono 로 변환, 16bit 로 변환 이걸 전부 따로 하더라구요.  
  
그래서 각 과정마다 PCM 데이터를 다 순회하는 부분을 개선했습니다. 물론 C++ 과 Rust 라는 언어의 차이도 크지 싶습니다.

### Comment 22647

- Author: cosine20
- Created: 2024-01-29T16:00:50+09:00
- Points: 1
- Parent comment: 22646
- Depth: 2

아 Rust 코드에선 저 세 과정을 따로 처리했었군요. 그걸 개선하는 것도 보통 일이 아니었을텐데 대단하십니다 ' v')b

### Comment 22648

- Author: fcbayernmuller
- Created: 2024-01-29T16:07:19+09:00
- Points: 1
- Parent comment: 22647
- Depth: 3

감사합니다~!!!
