Go Back   Winamp Forums > Developer Center > Winamp Development

Reply
Thread Tools Search this Thread Display Modes
Old 20th May 2004, 19:53   #1
timmay
Junior Member
 
Join Date: May 2004
Posts: 5
dsp plugin prob

Hi - has anyone ever made a dsp plugin before?

if so, how does the short int *samples array hold the information?

because it seems as though it goes from -32768 to 32768. if this is the case how is the sound data stored in this array?

ta
timmay is offline   Reply With Quote
Old 21st May 2004, 11:25   #2
timmay
Junior Member
 
Join Date: May 2004
Posts: 5
anyone know anything about dsp plugins or is this just a forum for media library's?
timmay is offline   Reply With Quote
Old 22nd May 2004, 02:49   #3
chris_d_smith
Senior Member
 
Join Date: Jan 2004
Posts: 161
this is just guessing from looking at the example dsp plugins but, it looks like:

each item in the array holds the amplitude of the sound wave at a given point in time. The range used to store the amplitude depends on the bps parameter. bps is eather 16 (range -32768 to 32768) or 8 (-128 to 128). The number of cells in the array is the number of channels (nch) multiplied by the number of samples (numsamples).

That all seems pretty certain. Taking a bigger guess, i'd say that the channels are interleaved in the array so that, if you have 2 channels then every even index in the array holds a sample for channel 1 (eg: left) and every odd index in the array holds a sample for channel 2.

The alternative would be that all samples for channel 1 come first and then all samples for channel 2 however that would seem to be much more difficult to construct as the input plugin reads the file.
chris_d_smith is offline   Reply With Quote
Old 22nd May 2004, 06:53   #4
timmay
Junior Member
 
Join Date: May 2004
Posts: 5
cheers chris - cleared a few things up
timmay is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > Winamp Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump