<commit_before>package audio

import "time"

type Ctrl struct {
	Streamer Streamer
	Paused   bool
	Duration time.Duration
}

func (c *Ctrl) Stream(samples [][2]float64) (n int, ok bool) {
	if c.Streamer == nil {
		return 0, false
	}
	if c.Paused {
		for i := range samples {
			samples[i] = [2]float64{}
		}
		return len(samples), true
	}
	n, ok = c.Streamer.Stream(samples)
	c.Duration += time.Duration(n) * time.Second / time.Duration(SampleRate)
	return n, ok
}
<commit_msg>audio: rename Ctrl.Duration -> Ctrl.Position<commit_after>package audio

import "time"

type Ctrl struct {
	Streamer Streamer
	Paused   bool
	Position time.Duration
}

func (c *Ctrl) Stream(samples [][2]float64) (n int, ok bool) {
	if c.Streamer == nil {
		return 0, false
	}
	if c.Paused {
		for i := range samples {
			samples[i] = [2]float64{}
		}
		return len(samples), true
	}
	n, ok = c.Streamer.Stream(samples)
	c.Position += time.Duration(n) * time.Second / time.Duration(SampleRate)
	return n, ok
}

{'fraction_non_alphanumeric': 0.1350253807106599, 'fraction_numerical': 0.014213197969543147, 'mean_word_length': 3.650943396226415, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7607246', 'n_tokens_mistral': 393, 'n_tokens_neox': 365, 'n_words': 101}