利用
shuf 弄混这些项目:#include <QTimer>解析器不成熟,所以不能有空行。真是浪费时间
#include <QIODevice>
#include <QScopedPointer>
#include <QByteArray>
#include <QLabel>
#include <QSlider>
#include <QAudioOutput>
#include <QMainWindow>
#include <QPushButton>
#include <QComboBox>
#include <QObject>
可悲的我终于又记起来了 print() 后直接退出程序不会刷新 stdout buffer 的。
不对,是我的 histogram 程序写错了,我还以为我记得住,不对是成功理解了的,真是令人悲伤的故事。
不对,是我的 histogram 程序写错了,我还以为我记得住,不对是成功理解了的,真是令人悲伤的故事。
[QTimer, QIODevice, QScopedPointer, QByteArray, QLabel, QSlider, QAudioOutput, QMainWindow, QPushButton, QComboBox, QObject]
QIODevice
QTimer
QAudioOutput
QObject
QScopedPointer
QByteArray
QMainWindow
QLabel
QComboBox
QPushButton
QSlider
修好 bug 后,本苏又觉得自己行了。
// audio: channel * sample
// sample: rate(sample pre sec) / size(bit size)
typealias Real = Double
typealias Sample = Double
abstract class SampleIterator: DoubleIterator {
final override fun hasNext() = true
final override fun nextDouble() = nextSample()
abstract fun nextSample(): Sample
}
typealias IndexedSampler = (Int) -> Sample
open class Wave(private val y: IndexedSampler): SampleIterator {
private var x = 0
override fun nextDouble() = y(x++)
}
open class RepeatWave(y: IndexedSampler, private val cycle: Real)
: Wave({ y(it) * cycle * ((i%cycle) /cycle) }) /*cycle realdiv (i%cycle)*/
object SinWave: RepeatWave({ sin(2*PI*it) }) 现在正在写
writeBytes("RIFF")
writeBytes("fmt")
writeShort(1); //format=PCM
writeShort(1); //channels
writeInt(_441kHz); //samples per sec
writeInt(_441kHz*1*(16/Byte.SIZE_BITS)); //byte rate
writeShort(1*(16/Byte.SIZE_BITS)); //block align
writeShort(16); //sample size=16
writeShort(0) //extend area
受不了了,这种东西明明应该由 org.duangsuse.bin 来处理。SinWave.kt
1.2 KB
#kotlin 就在我感到绝望的时候,突然发现一个 bug,一修完——马上一段空灵的声音响起,那是、那是……
Forwarded from Deleted Account
iseki 你说对了,我忘记 JDK 的 DataI/O Stream 全是大端……