Python Forum
Writing a floating point aifc file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Writing a floating point aifc file
#1
I'm an audio developer and would like to read and write 32 bit floating point audio files for test purposes. After hours of farting around, I've managed to realize that the problems I'm having are restricted to the floating point format. I can successfully write a 16 bit fixed point file from a numpy array (even though there are no examples in the aifc documentation).

I also saw a couple other libraries PySoundFile and Audiolab, though they were either really old and/or didn't install properly.

What is the right way to get this done in python. There are a shocking lack of google results on the subject of writing sound files in python. 

And if this is the wrong forum, could someone point to the right place?
Reply
#2
you can cast an integer to float with:
x = int(45)
print('x: {}'.format(x))
x = float(x)
print('x: {}'.format(x))
As far as audio packages in python, look here: https://pypi.python.org/pypi?%3Aaction=s...mit=search
And for AIFC files specifically: https://pypi.python.org/pypi?%3Aaction=s...mit=search
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  comparing floating point arrays to arrays of integers in Numpy amjass12 0 1,613 Jul-26-2021, 11:58 AM
Last Post: amjass12
  Python - Pandas writing blank files to file tdunphy 0 1,973 Jan-14-2021, 12:11 AM
Last Post: tdunphy
  HELP! writing to csv file repeats, but code looks good. TheBeast 2 2,193 Mar-26-2019, 10:09 PM
Last Post: TheBeast
  reading, modifying and writing json file metalray 2 10,884 Jun-06-2018, 03:09 PM
Last Post: metalray
  Upload csv file as numbers (floating?) and extract element, row, and column bentaz 7 4,415 Mar-19-2018, 05:34 PM
Last Post: bentaz

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020