We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSound,  Music Libraries › Ess: AudioStream vs. AudioChannel
Page Index Toggle Pages: 1
Ess: AudioStream vs. AudioChannel (Read 366 times)
Ess: AudioStream vs. AudioChannel
Aug 26th, 2008, 1:42pm
 
Hi -

I'm new to processing, and am trying to figure out what the differences are between AudioStream and AudioChannel in Ess.  Can anyone shed any light on this?

Looking at the signal generator examples, and they seem to use AudioChannel - which seems odd to me if AudioStream is supposed to be for real-time sound?

any help would be great!

thanks,

rama
Re: Ess: AudioStream vs. AudioChannel
Reply #1 - Aug 27th, 2008, 8:40am
 
my understanding of it:

AudioChannel is for writing a fixed sample size on the disk. So in order to use an oscillator, you create an AudioChannel with a fixed length, generate samples and write them into the AudioChannel, then play() the AudioChannel. Not good for a continuous stream of sound.

AudioStream, instead of a long fixed size, repeatedly calls its audioStreamWrite() method, in which you fill its buffer with a short bit of audio, which is then passed to the speakers. To use an oscillator here seems to require a bit of bookkeeping (updating the phase of the oscillator each time...)

hope that helps...
Page Index Toggle Pages: 1