Giter Site home page Giter Site logo

3dsound's Introduction

This is a quick script to generate 3D spatialized sounds for playback using jsonic (http://mindtrove.info/jsonic-speech-and-sound-using-html5/). 

I'm using the HRTF (head-related transfer function) measurements of a KEMAR dummy head micrphone data from MIT. The script should work on any sound format that sox can read. Run it like:

python hrtf.py infile outfolder

It will create the folder if it doesn't already exist. In the outfolder it will create files with names like a40.ogg which is the sound at 40 degrees azimuth with 0 degrees elevation. We could do elevation too but I stuck with only the horizontal plane for this.

It works by using sox to recode whatever format you give it to 22050Hz, mono, 16 bits. Then, for azimuth steps of 5 degrees it applies the HRTF filters to produce the left and right channels, and writes a wav file out. Then it uses sox again to encode the wav file to ogg and mp3 formats.

You'll need python + numpy + scipy + sox to use this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.