Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411511 Posts in 69375 Topics- by 58430 Members - Latest Member: Jesse Webb

April 26, 2024, 01:43:07 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperAudioEfficient Way to make Programmer Audio.
Pages: [1]
Print
Author Topic: Efficient Way to make Programmer Audio.  (Read 526 times)
Trash_Empire
Level 0
***



View Profile
« on: October 31, 2014, 06:28:51 PM »

Hey. I'm interested in making some placeholder audio during the prototyping phase of games, and I was wondering if there was a framework where you can script different audio things from nothing, and save it to disk in like a wav file or something. A comparison would be PIL, which is a python library where you can draw and edit images, and save them to disk in a desired format in a very simple way. So, something like that but for audio, and music in a simple script like for Python or something. Any feedback would be greatly appreciated.  Smiley Smiley Smiley
Logged
Sik
Level 10
*****


View Profile WWW
« Reply #1 on: October 31, 2014, 08:09:44 PM »

I think you're probably better off making some simple waveforms (sine wave, square wave, sawtooth wave, etc.) and using them as instruments in a tracker (then place notes to make sound effects). Then just convert the output to a WAV.

If you can't find a library that outputs WAV for the instruments here's the header for a 16-bit stereo WAV (all values except strings are little endian), then simply note that you have left and right samples interleaved (just use the same value twice if you don't care) and that they're 16-bit signed integers:

Code:
uint32 ... "RIFF"
uint32 ... Waveform size + 36
uint32 ... "WAVE"
uint32 ... "fmt "
uint32 ... 16
uint16 ... 1
uint16 ... 2
uint32 ... 44100
uint32 ... 44100*2*2
uint16 ... 2*2
uint16 ... 16
uint32 ... "data"
uint32 ... Waveform size

(waveform size is in bytes, so it's the waveform length × 4)

That said, sometimes you'll need better than that. For those cases I pick up some public domain sounds and then edit them in Audacity as needed (usually cutting parts and altering the volume, but sometimes I change the pitch too). I should probably some day make a good sound effect collection...
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic