Scripting: defaults not initialized in generators
- Dominant language
- C++
- Stars
- 18.4k
- Forks
- 2.7k
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 78
Description
### Bug description
When using a built-in generator from a scripting command, if the command does not explicitly set all parameters, unexpected results occur, which could include crashing Audacity or generating NaNs.
### Steps to reproduce
1. With mod-script-pipe enabled, launch Audacity.
2. Add a track and make a time selection.
3. Send the command "Tone:" to Audacity.
### Expected behavior
A default tone (Frequency=440Hz Amplitude=0.8 Waveform=Sine) to be generated that is the length of the selection.
### Actual behavior
On one occasion, the selection was filled with NaNs.
On another occasion, a tone with a frequency and amplitude that decreased to zero.
On another occasion, Audacity crashed.
### Audacity Version
current master / alpha / nightly build
### Operating system
Linux
### Additional context
Ref: https://manual.audacityteam.org/man/scripting_reference.html
Contributor guide
Research direction
Read the scripting reference for the Tone command, then reproduce the issue with mod-script-pipe using an incomplete command such as "Tone:" and a time selection. Trace the built-in generator path and ensure omitted parameters use the documented defaults: 440Hz, amplitude 0.8, and Sine waveform, producing the selection length without NaNs or a crash.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- audio-video-rtc
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100