# Is there a discrepancy between reported and actual SampleRate in AudioGenerator

When AudioGenerator is used to generate an Audio object, there may be a discrepancy between the specified (and reported) SampleRate and the actual time difference between the samples. This was observed while using the "Sin" generator, but easier to see using a generator function that returns the time value:

aud = AudioGenerator[Identity, 1/100, SampleRate -> 1000];
1./AudioSampleRate[aud]

(* Quantity[0.001, 1/("Hertz")] *)

First@AudioData@aud

(*  {0., 0.00111111, 0.00222222, 0.00333333, 0.00444444,
0.00555556, 0.00666667, 0.00777778, 0.00888889, 0.01} *)


This looks like an off-by-one error, so is probably not noticeable for long Audio objects, but obviously shifts short Audio objects to a lower frequency.

This has been reported to Wolfram support; I will update this post upon reply.

Version 11.2, macOS High Sierra

Update: Problem reproduced by Wolfram support, CASE:3969907.

Update: Fixed in 11.3

• You still need to put a question in there somewhere, since this is a Q&A site... – J. M. is away Nov 7 '17 at 21:42
• I prefer to think of is as a site to go to to find an answer to a question, whether or not it is phrased as a question. However, I rephrased the question. – Daniel W Nov 7 '17 at 23:01
• Behavior confirmed by Wolfram support, forwarded to developers. CASE:3969907. Does this mean I can put a "bugs" tag on this? – Daniel W Nov 9 '17 at 15:16
• I've put it in for you, but yes, you can do so upon confirmation. You might want to edit your question to mention that case number. – J. M. is away Nov 9 '17 at 15:18

aud = AudioGenerator[Identity, 1/100, SampleRate -> 1000];