UABE icon indicating copy to clipboard operation
UABE copied to clipboard

AudioClip

Open wycsbg opened this issue 3 years ago • 4 comments

Can you add import function for AudioClip plug-in

wycsbg avatar May 14 '22 19:05 wycsbg

Not sure if this will be feasible to add, as I want to substitute the FMOD library at some point. You can import an audio file manually, though.

If you have the audio as a compatible FSB* (e.g. from another Unity game), open the AudioClip in View Data and right clicking on the StreamedResource to import the FSB file. Then, correct the other properties inside the AudioClip (e.g. length in seconds).

Otherwise, you can create the FSB file yourself with the Unity engine / editor (unity.com). Two options:

  1. Needs some basic understanding of the Unity editor:
    • Create a new Unity project,
    • drag in your audio file,
    • add an audio source GameObject,
    • build the project
    • and finally export the AudioClip through UABE (View Data, export the StreamedResource).
  2. Needs some basic understanding of the command line:
    • Go to the Editor/Data/Tools/FSBTool/x64 directory in the Unity installation and start a cmd or PowerShell instance there.
    • Run (for instance): FSBTool64.exe -i <input file path> -o <fsb output file path> -l . -h . -c vorbis -C fsb

Then, import the FSB file as described above.

* some web games use m4a instead, other formats also are possible.

SeriousCache avatar May 15 '22 23:05 SeriousCache

不确定这是否可行,因为我想在某个时候替换 FMOD 库。不过,您可以手动导入音频文件。

如果您将音频作为兼容的 FSB*(例如来自另一个 Unity 游戏),请在 View Data 中打开 AudioClip 并右键单击 StreamedResource 以导入 FSB 文件。然后,更正 AudioClip 内的其他属性(例如,以秒为单位的长度)。

否则,您可以使用 Unity 引擎/编辑器 ( unity.com ) 自己创建 FSB 文件。 两种选择:

  1. 需要对 Unity 编辑器有一些基本的了解:

    • 创建一个新的 Unity 项目,
    • 拖入你的音频文件,
    • 添加一个音频源游戏对象,
    • 构建项目
    • 最后通过UABE导出AudioClip(查看数据,导出StreamedResource)。
  2. 需要对命令行有一些基本的了解:

    • 转到Editor/Data/Tools/FSBTool/x64Unity 安装中的目录并在其中启动 cmd 或 PowerShell 实例。
    • 运行(例如): FSBTool64.exe -i <input file path> -o <fsb output file path> -l . -h . -c vorbis -C fsb

然后,如上所述导入 FSB 文件。

  • 一些网页游戏使用 m4a 代替,其他格式也是可能的。

Not sure if this will be feasible to add, as I want to substitute the FMOD library at some point. You can import an audio file manually, though.

If you have the audio as a compatible FSB* (e.g. from another Unity game), open the AudioClip in View Data and right clicking on the StreamedResource to import the FSB file. Then, correct the other properties inside the AudioClip (e.g. length in seconds).

Otherwise, you can create the FSB file yourself with the Unity engine / editor (unity.com). Two options:

  1. Needs some basic understanding of the Unity editor:

    • Create a new Unity project,
    • drag in your audio file,
    • add an audio source GameObject,
    • build the project
    • and finally export the AudioClip through UABE (View Data, export the StreamedResource).
  2. Needs some basic understanding of the command line:

    • Go to the Editor/Data/Tools/FSBTool/x64 directory in the Unity installation and start a cmd or PowerShell instance there.
    • Run (for instance): FSBTool64.exe -i <input file path> -o <fsb output file path> -l . -h . -c vorbis -C fsb

Then, import the FSB file as described above.

  • some web games use m4a instead, other formats also are possible.

Thank you for your answer

wycsbg avatar May 16 '22 01:05 wycsbg

I have a problem with this method. When i try to use the command, i get always this error massage: "The system cannot find the file specified"

Satoshi-desu avatar Aug 09 '22 13:08 Satoshi-desu

I have a problem with this method. When i try to use the command, i get always this error massage: "The system cannot find the file specified"

Have you tried adding "input file path" quotation marks or removing <> these things whatever they are called?

Hlebuw3k avatar Jun 15 '23 07:06 Hlebuw3k