# opus_codec **Repository Path**: haozhu1997/opus_codec ## Basic Information - **Project Name**: opus_codec - **Description**: opus 编解码配置,java 接口 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-04-16 - **Last Updated**: 2025-06-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # java 包自定义 修改包路径 ``` -package com.example; +package com.example.ss; ``` 重新编译 ``` javac -encoding UTF-8 OpusCodec.java javac -encoding UTF-8 -h . OpusCodec.java ``` 生成 com_example_ss_OpusCodec.h 改名为 opus_wrapper.h,移动到 native opus_wrapper.c 中的 Java_com_example 替换为 Java_com_example_ss,进行下面的动态库编译 # 编译动态库 ## run in native linux JAVA_HOME 可能脚本检测不到,从外部传入 ``` mkdir build cd build cmake -DJAVA_HOME=$JAVA_HOME .. make ``` windows ``` mkdir build cd build cmake -G "Visual Studio 17 2022" -A x64 .. cmake --build . --config Release ``` ## run in java ``` javac -encoding UTF-8 com/example/*.java java -Djava.library.path=../native com.example.OpusCodec ```