hi olaf,
sorry, im not that deep in pd, but because i have ported over some max and pd objects to jmax, i can tell you from crashes similar to yours .... for example, in the fftease object buffers/vectors also accessd like :
for ( j = D; j > 0; j-- )
*++out = output[j] * mult;
such things often crashed .... i replaced it with the "usual" way to access arrays . when there was something "counting" in the wrong direction, i used a helper variable, k .....
k = 0;
for ( j = D; j > 0; j-- ) {
out[k] = output[j] * mult;
k++;
}
and voila, nothing crashed anymore ...... i banged my head to the wall finding out whats happened (too few bytes malloc'd ?? some bad pointer math ??) until i simply tried this way and it helped .... maybe it helps you as well, at least i would give it a try. btw, this way you always have a simple variable that shows you the actual position to read/write. so a simple post() will show it to you, whereas you never can tell at which position *++out actually is .... and simply reading one byte more where none is can crash seriously ....
hope it helps, tell me please ....
greets,
chris
Am Sonntag, 25. November 2001 18:26 schrieb Olaf Matthes:
Hi all,
this is an attempt to find someone who might have a look at the code of my first (currently non-working) external! It's called shoutcast~ and for Win only (maybe portable to Linux...)... It is intended to encode incoming audio to mp3 (using LAME) and send it to a SHOUTcast or IceCast server (IceCast untested right now). But there are to problems I can't solve:
- pd crashes when I try to read data from an internal buffer - I think
I'm just overlooking something, but after working on this for quite a while I'm somehow blind...
- my mp3 stream is silent. Encoding works well but on the way from the
inlets to the buffer that gets sent to the encoder something seems to be missing / not working. It's the same buffer that sometimes crashes pd!
It would be very nice if someone could have a look at my cources.... There was a discussion on this list concerning mp3 streaming with win. Maybe my external could make life easier: if we can get it to work!
The sources and additional information how things work and what goes wrong can be downloaded at: http://www.akustische-kunst.de/puredata/shoutcast~.zip (157k)
Many thanks!
Olaf