MiraiForum

    • 注册
    • 登录
    • 搜索
    • 热门
    • 最新
    • 未解决
    • 标签
    • 群组
    • 友情链接

    silk-codec -- 转换音频到 tx silk v3 格式

    其他项目发布
    1
    1
    527
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • Karlatemp
      Karlatemp 最后由 编辑

      Project https://github.com/KasukuSakura/silk-codec
      Bug report https://github.com/KasukuSakura/silk-codec/issues/new/choose
      Download binary https://github.com/KasukuSakura/silk-codec/releases/latest

      Platform supported

      • Windows x64
      • Windows x86
      • Linux x64
      • Linux arm64
      • Android x86
      • Android x86_64
      • Android arm64
      • Mac OS

      Usage

      CLI

      ffmpeg -y -i $INPUT -acodec pcm_s16le -f s16le -ac 1 tmp.pcm
      pcm_to_silk tmp.pcm $HZ out.silk
      
      ffmpeg version git-2020-08-16-5df9724 Copyright (c) 2000-2020 the FFmpeg developers
      Input #0, mp3, from 'Conqueror.mp3':
      Stream mapping:
        Stream #0:0 -> #0:0 (mp3 (mp3float) -> pcm_s16le (native))
      Press [q] to stop, [?] for help
      Output #0, s16le, to 'pipe:':
        Metadata:
          Stream #0:0: Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s
                                         ^~~~~
                                         It is $HZ
      

      Java

      Jar was published as io.github.kasukusakura:silk-codec

      public class A {
          public static void normal() throws Throwable {
              // System.load(); // load native if necessary
              var simpleRate = 44100;
              var pcm = "src.pcm";
      
              try (var som = new BufferedOutputStream(new FileOutputStream(
                      "out.silk"
              ))) {
                  SilkCoder.encode(
                          new BufferedInputStream(new FileInputStream(pcm)),
                          som,
                          simpleRate
                  );
              }
          }
      
          public static void any() throws Throwable {
              // System.load(); // load native if necessary
      
              var threadPool = Executors.newCachedThreadPool();
      
              var stream = new AudioToSilkCoder(threadPool);
              try (var fso = new BufferedOutputStream(new FileOutputStream("out.silk"))) {
                  stream.connect("ffmpeg", "src.mp3", fso);
              }
              System.out.println("DONE");
              threadPool.shutdown();
          }
      }
      
      1 条回复 最后回复 回复 引用 0
      • 1 / 1
      • First post
        Last post
      Powered by Mamoe Technologies & NodeBB | 友情链接 | 服务监控 | Contact