x


What does the numSamples parameter in GetOutputData actually mean?

Unfortunately, the documentation for AudioSource.GetOutputData() is a bit sparse so, what does the numSamples parameter mean? And what does the function exactly return (yes, an array but of what exactly)?

more ▼

asked Oct 14 '10 at 12:07 PM

xeophin gravatar image

xeophin
357 8 11 23

(comments are locked)
10|3000 characters needed characters left

1 answer: sort newest

The documentation on this is indeed lacking.

If you google define: audio samples, you'll get a fairly clear answer as to what audio samples are, but the simplest explanation is that all digital audio is actually a series of quantized energy levels (samples).

GetOutputData "returns a block of the currently playing source's output data." numSamples would be the number of such samples to return and therefore the size of the returned array. The array returned is an array of float values, representing the quantized value of each sample.

The real question is what "block" is it returning? Is it from the point in the output data where it is currently playing at the moment the function goes through (it reads like this may the case, but doesn't really say) or is it from the beginning of the output data or somewhere else?

more ▼

answered Oct 14 '10 at 02:42 PM

skovacs1 gravatar image

skovacs1
10k 11 25 91

As far as I tried the function out, it actually returns the value of where the audio is currently playing.

Oct 26 '10 at 04:41 PM xeophin
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x5060
x1026
x169

asked: Oct 14 '10 at 12:07 PM

Seen: 1215 times

Last Updated: Oct 14 '10 at 12:07 PM