{"id":16947610,"url":"https://github.com/mrdimas/hrir_sphere_builder","last_synced_at":"2026-03-12T08:02:15.307Z","repository":{"id":46050462,"uuid":"229912689","full_name":"mrDIMAS/hrir_sphere_builder","owner":"mrDIMAS","description":"Tool to create sphere from IRCAM HRIR database","archived":false,"fork":false,"pushed_at":"2021-11-17T17:55:00.000Z","size":87598,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T20:05:51.139Z","etag":null,"topics":["auralization","hrir","hrtf","ircam"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrDIMAS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-24T09:28:18.000Z","updated_at":"2025-04-10T06:09:35.000Z","dependencies_parsed_at":"2022-09-23T07:11:36.391Z","dependency_job_id":null,"html_url":"https://github.com/mrDIMAS/hrir_sphere_builder","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mrDIMAS/hrir_sphere_builder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrDIMAS%2Fhrir_sphere_builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrDIMAS%2Fhrir_sphere_builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrDIMAS%2Fhrir_sphere_builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrDIMAS%2Fhrir_sphere_builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrDIMAS","download_url":"https://codeload.github.com/mrDIMAS/hrir_sphere_builder/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrDIMAS%2Fhrir_sphere_builder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30419274,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T07:30:13.030Z","status":"ssl_error","status_checked_at":"2026-03-12T07:29:54.885Z","response_time":114,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["auralization","hrir","hrtf","ircam"],"created_at":"2024-10-13T21:47:43.031Z","updated_at":"2026-03-12T08:02:15.278Z","avatar_url":"https://github.com/mrDIMAS.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HRIR Sphere Builder\n\nSpecial tool to make HRIR sphere mesh from IRCAM http://recherche.ircam.fr/equipes/salles/listen/download.html base.\n\n## Pre-built database\n\nI already converted all IRCAM database entries, you can find them in `hrtf_base/IRCAM` - just pick any of `*.bin` files. Description of each can be found in link up above. \n\n## Usage\n\n`hrir_sphere_builder \u003cdirectory_path\u003e`\n\nOutput file will have this name: `directory_name.bin` and will be placed in parent directory of `directory_path`.\n\n## Why it is needed?\n\nHRIR database sampled at fixed angles - in case of IRCAM it has 15 degress azimuthal resolution and variable elavation resolution. Such fact gives annoying \"jumping\" effect of sound source spatial positioning. Resolution can be effectively increased by interpolation of HRIR's from three closest points for given source's azimuth and elevation. Working in spherical coordinates is error prone and may lead to various bugs, to bypass this we can use cartesian coordinate system. To be able to work in cartesian coordinates we need to know triangulated surface of a HRIR sphere so we can find a triangle which is intersected by ray from listener to sound source position. Once we have a triangle, we can use barycentric coordinates of a ray's intersection point to get weights for interpolation.\n\n## How it works?\n\nThe tool reads file-by-file from database and extracts azimuth and elevation from file name, then tool translates spherical coordinates to cartesion and adds hrir point to point cloud. Each file contains head-related impulse response for left and right ears. Each channel gets converted into array of floats in [0; 1] range (normalized range). After all points were created, tool creates convex hull using these points. Finally, triangulated hrir sphere saved to disk.\n\n## File format\n\nThe tool produces binary file, first goes header:\n\n| Field        | Size | Type     | Value |\n|--------------|------|----------|-------|\n| magic        | 4    | uint32_t | HRIR  |\n| sample_rate  | 4    | uint32_t |       |\n| length       | 4    | uint32_t |       |\n| vertex_count | 4    | uint32_t |       |\n| index_count  | 4    | uint32_t |       |\n\nThen goes indices:\n\n| Field   | Size            | Type     |\n|---------|-----------------|----------|\n| Indices | 4 * index_count | uint32_t |\n\nFinally goes `vertex_count` vertices, each vertex has this format:\n\n| Field      | Size       | Type  |\n|------------|------------|-------|\n| X          | 4          | float |\n| Y          | 4          | float |\n| Z          | 4          | float |\n| Left HRIR  | 4 * length | float |\n| Right HRIR | 4 * length | float |\n\n## How to use produced sphere?\n\n- Translate vector from listener position to sound source position into listener coordinate system (by multiplying vector with listener view matrix)\n- Use this vector to find an intersection point and intersected triangle with sphere mesh\n- Calculate barycentric coordinates of intersection point \n- Use barycentric coordinates as weights for HRTF samples (as reference you can use this paper - http://www02.smt.ufrj.br/~diniz/conf/confi117.pdf)\n\n## How to build the tool?\n\n`g++ -std=c++17 -o hrir_sphere_builder ./src/hrtf_builder.cpp`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrdimas%2Fhrir_sphere_builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrdimas%2Fhrir_sphere_builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrdimas%2Fhrir_sphere_builder/lists"}