feat(06-02): add freqCfgs parameter to RunSynthesis
- Change RunSynthesis signature to accept injected config map (D-10) - Replace hardcoded synth.ClassFreqConfigs with passed-in freqCfgs - Update all three RunSynthesis calls in encode tests to pass synth.ClassFreqConfigs
This commit is contained in:
+3
-2
@@ -41,9 +41,10 @@ func EncodeMP3(outputPath string, frames [][2]float64, sampleRate int) error {
|
||||
|
||||
// RunSynthesis consumes a slice of WindowSnapshots, renders audio via OscillatorBank,
|
||||
// and encodes to MP3 at outputPath.
|
||||
// freqCfgs is the merged config map from config.Load (D-10: injected, not hardcoded).
|
||||
// Returns an error if zero packets were captured (D-16 / OUT-03).
|
||||
// The zero-packet guard runs BEFORE file creation to avoid leaving an empty file on disk.
|
||||
func RunSynthesis(snapshots []classify.WindowSnapshot, outputPath string) error {
|
||||
func RunSynthesis(snapshots []classify.WindowSnapshot, outputPath string, freqCfgs map[classify.TrafficClass]synth.FreqConfig) error {
|
||||
// D-16 / OUT-03: Zero-packet guard — check BEFORE creating output file
|
||||
var totalPackets int64
|
||||
for _, snap := range snapshots {
|
||||
@@ -54,7 +55,7 @@ func RunSynthesis(snapshots []classify.WindowSnapshot, outputPath string) error
|
||||
}
|
||||
|
||||
// Render all windows to stereo frames
|
||||
bank := synth.NewBank(1.0, synth.ClassFreqConfigs) // tau=1.0s per D-07
|
||||
bank := synth.NewBank(1.0, freqCfgs) // tau=1.0s per D-07
|
||||
var allFrames [][2]float64
|
||||
for _, snap := range snapshots {
|
||||
frames := bank.RenderWindow(snap)
|
||||
|
||||
Reference in New Issue
Block a user