<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">Hi,</div><div class=""><br class=""></div><div class="">I’m wondering how can I get the speech/music classification result when encoding the audio in opus 1.3.1?</div><div class=""><br class=""></div><div class="">I found in the file opus_encoder.c, there is a opus_encoder_ctl request as <span class="" style="color: rgba(0, 0, 0, 0.85098); font-family: Menlo; background-color: rgb(255, 255, 255);">OPUS_GET_VOICE_RATIO_REQUEST, so I wrote in my program the below code:</span></div><div class=""><span class="" style="color: rgba(0, 0, 0, 0.85098); font-family: Menlo; background-color: rgb(255, 255, 255);"><br class=""></span></div><div class=""><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(93, 108, 121); background-color: rgb(255, 255, 255);">#define OPUS_GET_VOICE_RATIO(x) 11019, __opus_check_int_ptr(x)</div></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(93, 108, 121); background-color: rgb(255, 255, 255);"><br class=""></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);"><div class="" style="color: rgba(0, 0, 0, 0.85098); font-family: Menlo; margin: 0px; font-stretch: normal; line-height: normal;"><span class="" style="color: rgb(57, 0, 160);">int32_t</span> voiceRatio;</div><div class="" style="color: rgb(50, 109, 116); font-family: Menlo; margin: 0px; font-stretch: normal; line-height: normal;">opus_encoder_ctl<span class="" style="color: rgba(0, 0, 0, 0.85098);">(</span>encoder<span class="" style="color: rgba(0, 0, 0, 0.85098);">, </span>OPUS_GET_VOICE_RATIO<span class="" style="color: rgba(0, 0, 0, 0.85098);">(&voiceRatio));</span></div><div class="" style="color: rgba(0, 0, 0, 0.85098); font-family: Menlo; margin: 0px; font-stretch: normal; line-height: normal;"><span class="" style="color: rgb(100, 56, 32);">LOGI</span>(<span class="" style="color: rgb(196, 26, 22);">"voice ratio:%d"</span>, voiceRatio);</div><div class="" style="color: rgba(0, 0, 0, 0.85098); font-family: Menlo; margin: 0px; font-stretch: normal; line-height: normal;"><br class=""></div><div class="" style="color: rgba(0, 0, 0, 0.85098); font-family: Menlo; margin: 0px; font-stretch: normal; line-height: normal;">But it always return -1.</div><div class="" style="color: rgba(0, 0, 0, 0.85098); font-family: Menlo; margin: 0px; font-stretch: normal; line-height: normal;"><br class=""></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal;"><font face="Menlo" class=""><span class="" style="color: rgba(0, 0, 0, 0.85098);">And then I found that in the opus_encoder.c, the classification can only enable when </span></font><font color="#643820" face="Menlo" class="">#ifndef DISABLE_FLOAT_API, but I<span class="">’</span>m not sure if & where we define the </font><span class="" style="caret-color: rgb(100, 56, 32); color: rgb(100, 56, 32); font-family: Menlo;">DISABLE_FLOAT_API? How can I build the lib without this macro?</span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal;"><span class="" style="caret-color: rgb(100, 56, 32); color: rgb(100, 56, 32); font-family: Menlo;"><br class=""></span></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal;"><span class="" style="caret-color: rgb(100, 56, 32); color: rgb(100, 56, 32); font-family: Menlo;">I build the lib for IOS, using the script at </span><a href="https://github.com/chrisballinger/Opus-iOS" class="">https://github.com/chrisballinger/Opus-iOS</a></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal;"><br class=""></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal;">It takes me several days to test but no success, can you help me?</div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal;"><br class=""></div><div class="" style="margin: 0px; font-stretch: normal; line-height: normal;">Thank you very much!</div></div></body></html>