Message Boards Message Boards

0
|
2231 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

AudioGenerator["Sin"]: Manipulate Options for Length

Posted 1 year ago

Hi,

I'm trying to use Manipulate[] with AudioGenerator to generate a Sine wave for a range of audio frequencies, and for a given span of time. I must not be understanding this correctly because I can control frequency and audio volume, but cannot seem to pick a specific length of time if I am also selecting frequency. All of this is for generating short sine waves between 100 and 3000 Hz, and wanting to pick a duration of between 0.25 seconds and 2 seconds.

Here is an example where I cannot get length of time to change:

Manipulate[
 AudioGenerator[
  {"Sin", freq, length}, SoundVolume -> volume],
 {freq, 100, 3000},
 {length, 0.7, 100.0},
 {volume, 0.01, 0.08}
 ]

What am I missing? How do I manipulate time plus frequency plus volume?

If it matters, I'm using Mathematica 11.3.

POSTED BY: Dan Stimits
2 Replies
Posted 1 year ago

Thank you! That worked.

POSTED BY: Dan Stimits
Posted 1 year ago

Try moving the righthand curly bracket in the arguments to AudioGenerator:

Manipulate[
  AudioGenerator[{"Sin",freq},length,SoundVolume->volume],
  {freq,100,3000},
  {length,0.7,100.0},
  {volume,0.01,0.08}
]
POSTED BY: Hans Milton
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract