Jump to content

Python Audio Import...


Thomas Helzle

Recommended Posts

After a request from @srletak I post my python audio import HDA here.

This is the original post this was used for: 

Multiple qualifiers apply:
- This was my first python script and I somehow do not really agree with this funny language so far (was raised on C...) so it's really hacked together without me knowing what I do.
- I didn't know where to put the library I used for import so I copied the relevant part into the script directly.
- This is the library: https://github.com/mgeier/python-audio/blob/master/audio-files/audio-files-with-wave.ipynb
- I only wanted to load 24Bit, 48KHz, Stereo Wave files, so that's the only thing it deals with - one small sample .wav is included.
- I didn't understand how to make python read a spare parameter so you have to go into the code of the HDA and set the path to the audio file manually (I marked the line in the script).

- Since geometry generation with python turned out to be abysmally slow, I removed the code for that and only import the points and some file info (see the detail attributes).
- There is one group for the left channel to help separate left and right.

The included .hip file does nothing but load the HDA. You can then go into the code (rightclick the node -> Type Properties -> Code) and enter the (absolute) path to where you put the audio file.
This gives you every sample of the wave file as a point in space for further mangling.

I'm sure a real Python wiz can do a much better job, so if you improve the script, feel free to post it here or do with it whatever you want.

This was created in Houdini Core 16.5.

Cheers,

Tom

AudioImport.zip

Link to comment
Share on other sites

Cool it works for you!

I wanted to apply a FFT to the audio to be able to extract frequencies and the phase etc. but haven't been able to find an OpenCL (or other) solution for that so far (other than the strange CHOP-stuff which works up to a point but not how I'd like it to)...

Cheers,

Tom

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...