mattintosh note

Hello Raspberry Pi!

qaac の準備が面倒くさいのでスクリプト化した

LinuxiTunesAAC/ALAC エンコーダーを使うために WINE 経由で qaac を使うんだけど、qaac の準備がめんどくさかったのでスクリプト化した。

Linux で qaac を使う方法は過去記事参照。

mattintosh.hatenablog.com

qaac のバージョンは執筆時点では 2.64。引数に WindowsiTunes 64-bit 版のインストーラーを指定すればいいだけにしてある。

2.64 固定番と最新版の2種類がある。git ls-remote で最新のタグを拾おうかと思ったけど、GitHubAPI で最新版の名前と URL が取得できたので jq で済ますことにした。

  • p7zip、curl が必要。latest の場合は jq も必要。
  • 2.64 固定番で qaac のバージョンを上げたければ QAAC_VERSIONQAAC_SHA1SUM を変更する。

■ 2.64 固定版

$ git clone https://gist.github.com/mattintosh4/d5116168d0743d437ea1150cf11588d7 qaac_builder
$ cd qaac_builder
$ bash qaac_builder_2.64.sh ~/Downloads/iTunes64Setup.exe

■ 最新版

$ git clone https://gist.github.com/mattintosh4/d5116168d0743d437ea1150cf11588d7 qaac_builder
$ cd qaac_builder
$ bash qaac_builder_latest.sh ~/Downloads/iTunes64Setup.exe

WINE で qaac64.exe を実行してエラーが出なければOK。

$ wine qaac_2.64/qaac64.exe --check
qaac 2.64, CoreAudioToolbox 7.10.9.0
libsoxconvolver 0.1.0
libsoxr-0.1.3b1

Docker イメージでも作るかな…。

■ 2.64 固定版スクリプト

■ 最新版スクリプト

なお、最新版の JSONhttps://api.github.com/repos/nu774/qaac/releases/latest で取得することができる。

{
  "url": "https://api.github.com/repos/nu774/qaac/releases/6441962",
  "assets_url": "https://api.github.com/repos/nu774/qaac/releases/6441962/assets",
  "upload_url": "https://uploads.github.com/repos/nu774/qaac/releases/6441962/assets{?name,label}",
  "html_url": "https://github.com/nu774/qaac/releases/tag/v2.64",
  "id": 6441962,
  "tag_name": "v2.64",
  "target_commitish": "master",
  "name": "v2.64",
  "draft": false,
  "author": {
    "login": "nu774",
    "id": 489444,
    "avatar_url": "https://avatars3.githubusercontent.com/u/489444?v=4",
    "gravatar_id": "",
    "url": "https://api.github.com/users/nu774",
    "html_url": "https://github.com/nu774",
    "followers_url": "https://api.github.com/users/nu774/followers",
    "following_url": "https://api.github.com/users/nu774/following{/other_user}",
    "gists_url": "https://api.github.com/users/nu774/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/nu774/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/nu774/subscriptions",
    "organizations_url": "https://api.github.com/users/nu774/orgs",
    "repos_url": "https://api.github.com/users/nu774/repos",
    "events_url": "https://api.github.com/users/nu774/events{/privacy}",
    "received_events_url": "https://api.github.com/users/nu774/received_events",
    "type": "User",
    "site_admin": false
  },
  "prerelease": false,
  "created_at": "2017-05-19T12:21:05Z",
  "published_at": "2017-05-19T12:29:11Z",
  "assets": [
    {
      "url": "https://api.github.com/repos/nu774/qaac/releases/assets/3912283",
      "id": 3912283,
      "name": "qaac_2.64.zip",
      "label": null,
      "uploader": {
        "login": "nu774",
        "id": 489444,
        "avatar_url": "https://avatars3.githubusercontent.com/u/489444?v=4",
        "gravatar_id": "",
        "url": "https://api.github.com/users/nu774",
        "html_url": "https://github.com/nu774",
        "followers_url": "https://api.github.com/users/nu774/followers",
        "following_url": "https://api.github.com/users/nu774/following{/other_user}",
        "gists_url": "https://api.github.com/users/nu774/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/nu774/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/nu774/subscriptions",
        "organizations_url": "https://api.github.com/users/nu774/orgs",
        "repos_url": "https://api.github.com/users/nu774/repos",
        "events_url": "https://api.github.com/users/nu774/events{/privacy}",
        "received_events_url": "https://api.github.com/users/nu774/received_events",
        "type": "User",
        "site_admin": false
      },
      "content_type": "application/x-zip-compressed",
      "state": "uploaded",
      "size": 3055646,
      "download_count": 2190,
      "created_at": "2017-05-19T12:28:48Z",
      "updated_at": "2017-05-19T12:29:09Z",
      "browser_download_url": "https://github.com/nu774/qaac/releases/download/v2.64/qaac_2.64.zip"
    }
  ],
  "tarball_url": "https://api.github.com/repos/nu774/qaac/tarball/v2.64",
  "zipball_url": "https://api.github.com/repos/nu774/qaac/zipball/v2.64",
  "body": "Fixed regression of 2.63: HE-AAC frames were incorrectly multiplexed."
}