진행중인 프로젝트가 알송가사 서버를 사용해야 하기 때문에 어떻게 가사를 정확하게 받아와야 하는지 알아야만 했다.
그린세상님의 BLOG 에서 많은 정보를 얻어 올 수 있었다.
먼저 MP3파일의 구조부터 확인해보자.
MP3 파일의 기본적인 구조는 이러하며 ID3 TAG는 버전이 V1.0, V1.1, V2.0 3가지가 있다.


가사 요청 PACKET 내용
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV='http://www.w3.org/2003/05/soap-envelope' xmlns:SOAP-ENC='http://www.w3.org/2003/05/soap-encoding' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:ns2='ALSongWebServer/Service1Soap' xmlns:ns1='ALSongWebServer' xmlns:ns3='ALSongWebServer/Service1Soap12'>
<SOAP-ENV:Body>
<ns1:GetLyric5>
<ns1:stQuery>
<ns1:strChecksum>
MD5
</ns1:strChecksum>
<ns1:strVersion>1.93</ns1:strVersion>
<ns1:strMACAddress></ns1:strMACAddress>
<ns1:strIPAddress></ns1:strIPAddress>
</ns1:stQuery>
</ns1:GetLyric5>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
MD5 값에 들어갈 내용은 MP3파일에서 ID태그 부분을 제외한 순수 음악 데이터부터 163840 바이트를 읽어서 MD5 HASH 처리한 값이 들어가게 된다.
댓글 없음:
댓글 쓰기