electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » Developers' Corner
APIs for creating sound files
Post new topic   Reply to topic Moderators: DrJustice
Page 1 of 1 [5 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
Antimon



Joined: Jan 18, 2005
Posts: 4145
Location: Sweden
Audio files: 371
G2 patch files: 100

PostPosted: Sat Sep 13, 2008 2:41 am    Post subject: APIs for creating sound files
Subject description: any programming language
Reply with quote  Mark this post and the followings unread

I've been toying with some ideas about algorithms that might be used to create sound. The problem with these algorithms is that they're probably a bit to processing-heavy to be used in realtime (as in something like ChucK). So what I'm really after is some simple API that would let me create a wav file (or some other useful format) out of a pack of numbers. So I'll create the waveform in my program, feed all the resulting numbers to a function that then creates a sound file on the disk that I can play in a sampler program.

Anyone know of such an API? I would prefer if it would be in Java, C, C++ or maybe even Python, but any language would do (it could be an opportunity to learn that language). I could probably make it happen in ChucK, but would like to use a more general purpose language like one of the previously mentioned.

/Stefan

_________________
Antimon's Window
@soundcloud @Flattr home - you can't explain music
Back to top
View user's profile Send private message Visit poster's website
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24079
Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320

PostPosted: Sat Sep 13, 2008 3:16 am    Post subject: Reply with quote  Mark this post and the followings unread

For writing a WAV file in PCM you don't need much, see http://www.lightlink.com/tjweber/StripWav/Canon.html . And when you feel like the header is too troublesome you can just skip that part to only write the data and then later import the file as RAW into a program like Audacity.
_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
DrJustice



Joined: Sep 13, 2004
Posts: 2114
Location: Morokulien
Audio files: 4

PostPosted: Sat Sep 13, 2008 5:11 am    Post subject: Reply with quote  Mark this post and the followings unread

Then there's always libsndfile if you need someting to handle lots of formats.

DJ
--
Back to top
View user's profile Send private message Visit poster's website
Antimon



Joined: Jan 18, 2005
Posts: 4145
Location: Sweden
Audio files: 371
G2 patch files: 100

PostPosted: Sat Sep 13, 2008 10:48 am    Post subject: Reply with quote  Mark this post and the followings unread

Thanks a bunch! Very Happy

Ooh - a data format spec and a c library. I find formatting data a fun, relaxing programming exercise, but I might get a result faster from the c library. Which should I choose... drunken

/Stefan

_________________
Antimon's Window
@soundcloud @Flattr home - you can't explain music
Back to top
View user's profile Send private message Visit poster's website
BobTheDog



Joined: Feb 28, 2005
Posts: 4044
Location: England
Audio files: 32
G2 patch files: 15

PostPosted: Tue Sep 23, 2008 5:19 am    Post subject: Reply with quote  Mark this post and the followings unread

Go for the library.

If you are interested you can always look at the code.

Cheers

Andy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: DrJustice
Page 1 of 1 [5 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Developers' Corner
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use